#import @class GHGherkinLineSpan; @protocol GHGherkinLineProtocol @property (nonatomic, readonly) NSString * lineText; @property (nonatomic, readonly) NSUInteger lineNumber; @property (nonatomic, readonly) NSUInteger indent; /// /// Called by the parser to indicate non-streamed reading (e.g. during look-ahead). /// /// /// If the implementation depends on streamed reading behavior, with this method, it can clone itself, so that it will be detached. /// - (void)detach; /// /// Gets if the line is empty or contains whitespaces only. /// /// YES, if empty or contains whitespaces only; otherwise, NO. - (BOOL)empty; /// /// Determines whether the beginning of the line (wihtout whitespaces) matches a specified string. /// /// The string to compare. /// YES if text matches the beginning of this line; otherwise, NO. - (BOOL)hasPrefix:(NSString *)theText; /// /// Determines whether the beginning of the line (wihtout whitespaces) matches a specified title keyword (ie. a keyword followed by a ':' character). /// /// The keyword to compare. /// YES if keyword matches the beginning of this line and followed by a ':' character; otherwise, NO. - (BOOL)hasTitleKeywordPrefix:(NSString *)theKeyword; /// /// Returns the line text /// /// The maximum number of whitespace characters to remove. -1 removes all leading whitespaces. /// The line text. - (NSString *)lineTextByRemovingIndent:(NSInteger)theIndentToRemove; /// /// Returns the remaining part of the line. /// /// /// - (NSString *)trimmedRest:(NSUInteger)theLength; /// /// Tries parsing the line as a tag list, and returns the tags wihtout the leading '@' characters. /// /// (position,text) pairs, position is 0-based index - (NSArray *)tags; /// /// Tries parsing the line as table row and returns the trimmed cell values. /// /// (position,text) pairs, position is 0-based index - (NSArray *)tableCells; @end