GBCommentComponentsProvider Class Reference
| Inherits from | NSObject |
| Declared in | GBCommentComponentsProvider.h GBCommentComponentsProvider.m |
Overview
Provides comment keywords and helpers for the rest of the application.
The main responsibility of the class is to determine if a string contains special section definition. In addition, they also return section parameters. This encapsulates keywords and sections handling and simplifies the rest of the application.
Tasks
Initialization & disposal
-
+ providerReturns a new autoreleasedGBCommentComponentsProviderinstance.
Parameters
-
crossReferenceMarkersTemplateSets cross reference markers. property
Lists definitions
-
orderedListRegexReturns the regex used for matching ordered lists with capture 1 containing lists indent and capture 2 string value. property -
unorderedListRegexReturns the regex used for matching unordered lists with capture 1 containing list indent and capture 2 string value. property
Sections definitions
-
warningSectionRegexReturns the regex used for matching warning section with capture 1 containing description. property -
bugSectionRegexReturns the regex used for matching bug section with capture 1 containing description. property -
exampleSectionRegexReturns the regex used for matching example section with capture 1 containing whitespace prefix and capture 2 example text. property
Method specific definitions
-
methodGroupRegexReturns the regex used for matching method groups with capture 1 containing section name. property -
argumentsMatchingRegexReturns the regex used for matching different method parameter descriptions within the paragraph. property -
nextArgumentRegexReturns the regex used for finding next method parameter description within the paragraph. property -
parameterDescriptionRegexReturns the regex used for matching method parameter description with capture 1 containing parameter name and capture 2 description. property -
returnDescriptionRegexReturns the regex used for matching method return description with capture 1 containing description. property -
exceptionDescriptionRegexReturns the regex used for matching method exception description with capture 1 containing exception name and capture 2 description. property -
crossReferenceRegexReturns the regex used for matching cross reference directive with capture 1 containing link. property
Cross references definitions
-
– remoteMemberCrossReferenceRegex:Returns the regex used for matching (possible) remote member cross references with capture 1 containing object name and capture 2 member name. -
– localMemberCrossReferenceRegex:Returns the regex used for matching (possible) local member cross reference with capture 1 containing member name. -
– categoryCrossReferenceRegex:Returns the regex used for matching (possible) category cross reference with capture 1 containing category name. -
– objectCrossReferenceRegex:Returns the regex used for matching (possible) class or protocol cross reference with capture 1 containing object name. -
– urlCrossReferenceRegex:Returns the regex used for matching URL cross reference with caption 1 contining the URL itself.
Common definitions
-
newLineRegexReturns the regex containing all possible symbols for matching new lines. property
Properties
argumentsMatchingRegex
Returns the regex used for matching different method parameter descriptions within the paragraph.
@property (readonly) NSString *argumentsMatchingRegexDeclared In
GBCommentComponentsProvider.hbugSectionRegex
Returns the regex used for matching bug section with capture 1 containing description.
@property (readonly) NSString *bugSectionRegexDeclared In
GBCommentComponentsProvider.hcrossReferenceMarkersTemplate
Sets cross reference markers.
@property (copy) NSString *crossReferenceMarkersTemplateDiscussion
The given string should include optional prefix, followed by %@ and lastly optional suffix. If either prefix or suffix isn't allowed, just pass %@. At the runtime, %@ is replaced by the actual regex for mathching particular cross reference type - actually the whole string becomes the regex for matching cross reference, therefore prefix and suffix can be arbitrary regex expressions themselves! On the other hand, this imposes some limitations to what can be used for them:
- Prefix and suffix must not contain any capturing components as this will break matching code (you can still include groups, but make sure any open parenthesis is marked as non-capturing like this:
(?! - Prefix must not contain any marker used for formatting such as *, _ or combinations. This is actually not checked, but in such case results may be not what you wanted.
Important: Note that the given string must contain exactly one %@ marker. If none is included cross references will not be matched during runtime. If more than one is included, unpredicted behavior may occur. So take care!
Important: This value must be set before accessing any cross reference regex property! The accessors prepare and cache the value on first usage. From then on, cached value is returned, so any change is not propagated!
Declared In
GBCommentComponentsProvider.hcrossReferenceRegex
Returns the regex used for matching cross reference directive with capture 1 containing link.
@property (readonly) NSString *crossReferenceRegexDeclared In
GBCommentComponentsProvider.hexampleSectionRegex
Returns the regex used for matching example section with capture 1 containing whitespace prefix and capture 2 example text.
@property (readonly) NSString *exampleSectionRegexDeclared In
GBCommentComponentsProvider.hexceptionDescriptionRegex
Returns the regex used for matching method exception description with capture 1 containing exception name and capture 2 description.
@property (readonly) NSString *exceptionDescriptionRegexDeclared In
GBCommentComponentsProvider.hmethodGroupRegex
Returns the regex used for matching method groups with capture 1 containing section name.
@property (readonly) NSString *methodGroupRegexDeclared In
GBCommentComponentsProvider.hnewLineRegex
Returns the regex containing all possible symbols for matching new lines.
@property (readonly) NSString *newLineRegexDeclared In
GBCommentComponentsProvider.hnextArgumentRegex
Returns the regex used for finding next method parameter description within the paragraph.
@property (readonly) NSString *nextArgumentRegexDeclared In
GBCommentComponentsProvider.horderedListRegex
Returns the regex used for matching ordered lists with capture 1 containing lists indent and capture 2 string value.
@property (readonly) NSString *orderedListRegexDeclared In
GBCommentComponentsProvider.hparameterDescriptionRegex
Returns the regex used for matching method parameter description with capture 1 containing parameter name and capture 2 description.
@property (readonly) NSString *parameterDescriptionRegexDeclared In
GBCommentComponentsProvider.hreturnDescriptionRegex
Returns the regex used for matching method return description with capture 1 containing description.
@property (readonly) NSString *returnDescriptionRegexDeclared In
GBCommentComponentsProvider.hInstance Methods
categoryCrossReferenceRegex:
Returns the regex used for matching (possible) category cross reference with capture 1 containing category name.
- (NSString *)categoryCrossReferenceRegex:(BOOL)templatedParameters
- templated
- If
YEStemplated regex is returned, otherwise pure one.
Return Value
Returns the regex used for matching cross reference.
Discussion
The result of the method depends on the templated value: if the value is YES, the string includes template from crossReferenceMarkersTemplate, otherwise it only contains "pure" regex. The first option should be used for in-text cross references detection, while the second for crossReferenceRegex matching.
Declared In
GBCommentComponentsProvider.hlocalMemberCrossReferenceRegex:
Returns the regex used for matching (possible) local member cross reference with capture 1 containing member name.
- (NSString *)localMemberCrossReferenceRegex:(BOOL)templatedParameters
- templated
- If
YEStemplated regex is returned, otherwise pure one.
Return Value
Returns the regex used for matching cross reference.
Discussion
The result of the method depends on the templated value: if the value is YES, the string includes template from crossReferenceMarkersTemplate, otherwise it only contains "pure" regex. The first option should be used for in-text cross references detection, while the second for crossReferenceRegex matching.
Declared In
GBCommentComponentsProvider.hobjectCrossReferenceRegex:
Returns the regex used for matching (possible) class or protocol cross reference with capture 1 containing object name.
- (NSString *)objectCrossReferenceRegex:(BOOL)templatedParameters
- templated
- If
YEStemplated regex is returned, otherwise pure one.
Return Value
Returns the regex used for matching cross reference.
Discussion
The result of the method depends on the templated value: if the value is YES, the string includes template from crossReferenceMarkersTemplate, otherwise it only contains "pure" regex. The first option should be used for in-text cross references detection, while the second for crossReferenceRegex matching.
Declared In
GBCommentComponentsProvider.hremoteMemberCrossReferenceRegex:
Returns the regex used for matching (possible) remote member cross references with capture 1 containing object name and capture 2 member name.
- (NSString *)remoteMemberCrossReferenceRegex:(BOOL)templatedParameters
- templated
- If
YEStemplated regex is returned, otherwise pure one.
Return Value
Returns the regex used for matching cross reference.
Discussion
The result of the method depends on the templated value: if the value is YES, the string includes template from crossReferenceMarkersTemplate, otherwise it only contains "pure" regex. The first option should be used for in-text cross references detection, while the second for crossReferenceRegex matching.
Declared In
GBCommentComponentsProvider.hurlCrossReferenceRegex:
Returns the regex used for matching URL cross reference with caption 1 contining the URL itself.
- (NSString *)urlCrossReferenceRegex:(BOOL)templatedParameters
- templated
- If
YEStemplated regex is returned, otherwise pure one.
Return Value
Returns the regex used for matching cross reference.
Discussion
The result of the method depends on the templated value: if the value is YES, the string includes template from crossReferenceMarkersTemplate, otherwise it only contains "pure" regex. The first option should be used for in-text cross references detection, while the second for crossReferenceRegex matching.
Declared In
GBCommentComponentsProvider.h