Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 364 lines (303 sloc) 14.189 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
//
// XMLBasedOutputGenerator+ObjectParsingAPI.h
// appledoc
//
// Created by Tomaz Kragelj on 28.5.09.
// Copyright (C) 2009, Tomaz Kragelj. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMLBasedOutputGenerator.h"

//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
/** Defines helper methods private for the @c XMLBasedOutputGenerator and it's subclasses that
help parsing object related documentation.
*/
@interface XMLBasedOutputGenerator (ObjectParsingAPI)

//////////////////////////////////////////////////////////////////////////////////////////
/// @name Object info items parsing support
//////////////////////////////////////////////////////////////////////////////////////////

/** Extracts the object info item reference value for the given item.

@param item The item which reference to te return.
@return Returns the item reference or @c nil if not found.
@see extractObjectInfoItemValue:
*/
- (NSString*) extractObjectInfoItemRef:(id) item;

/** Extracts the object info item value for the given item.

@param item The item which value to te return.
@return Returns the item value or @c nil if not found.
@see extractObjectInfoItemRef:
*/
- (NSString*) extractObjectInfoItemValue:(id) item;

//////////////////////////////////////////////////////////////////////////////////////////
/// @name Object tasks parsing support
//////////////////////////////////////////////////////////////////////////////////////////

/** Extracts the task name from the given task item.

@param item The task item which name to return.
@return Returns the section name or @c nil if not found.
*/
- (NSString*) extractObjectTaskName:(id) item;

//////////////////////////////////////////////////////////////////////////////////////////
/// @name Object members parsing support
//////////////////////////////////////////////////////////////////////////////////////////

/** Extracts the member type fromt he given item.

The result is one of the following:
- @c kTKObjectMemberTypeClass: The member is a class method.
- @c kTKObjectMemberTypeInstance: The member is an instance method.
- @c kTKObjectMemberTypeProperty: The member is a property.

@param item The member item which type to return.
@return Returns the member kind.
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (int) extractObjectMemberType:(id) item;

/** Extracts the member name from the given member item.

@param item The member item which name to return.
@return Returns the member name or @c nil if not found.
@see extractObjectMemberType:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (NSString*) extractObjectMemberName:(id) item;

/** Extracts the member selector name from the given member item.

@param item The member item which selector name to return.
@return Returns the member selector name or @c nil if not found.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (NSString*) extractObjectMemberSelector:(id) item;

/** Extracts the member file name from the given member item.

@param item The member item which file name to return.
@return Returns the member file name or @c nil if not found.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (NSString*) extractObjectMemberFile:(id) item;

/** Extracts the member prototype item from the given member item.

The returned item can be used by @c extractObjectMemberPrototypeSubitems:() to get
individual components. Then use @c extractObjectMemberPrototypeItemType:() and
@c extractObjectMemberPrototypeItemValue:() to get data for the individual components.
@param item The member item which prototype item to return.
@return Returns the member prototype item or @c nil if not found.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
@see extractObjectMemberPrototypeSubitems:
@see extractObjectMemberPrototypeItemType:
@see extractObjectMemberPrototypeItemValue:
*/
- (id) extractObjectMemberPrototypeItem:(id) item;

/** Extracts the member description item from the given member item.

The returned item can be used by @c extractBriefDescriptionFromItem:(),
@c extractBriefDescriptionsFromItem:() and @c extractDetailDescriptionsFromItem:() to get
individual description components.

@param item The member item which description item to return.
@return Returns the member description item or @c nil if not found.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (id) extractObjectMemberDescriptionItem:(id) item;

/** Extracts the member section items from the given member item.
The type can be one of the following:
- @c kTKObjectMemberSectionParameters: The array of all parameters will be returned.
- @c kTKObjectMemberSectionExceptions: The array of all exceptions will be returned.
Since all sections have the same layout, all section helpers can be used. The section
helpers are:
- @c extractObjectMemberPrototypeSubitems:()
- @c extractObjectMemberPrototypeItemType:()
- @c extractObjectMemberPrototypeItemValue:()

@param item The member item which parameters to return.
@param type The type of section to return.
@return Returns the array of items representing the member's parameters or @c nil if not found.
@warning Passing a @c type value other than one of the described here-in, may result in
unpredictable behavior.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (NSArray*) extractObjectMemberSectionItems:(id) item
type:(int) type;

/** Extracts the member return item contents fromthe given member item.

The returned value contains the same layout as any other brief or detailed description
item, so it can be treated in the same way, including all formatting and other specifics
such as links generation. In most cases, at last one paragraph subitem is contained as
the child item.

@param item The member item which return description to get.
@return Returns the return item of the given member or @c nil if not found.
@exception NSException Thrown if extraction fails.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (id) extractObjectMemberReturnItem:(id) item;

/** Extracts the member warning item contents fromthe given member item.

The returned value contains the same layout as any other brief or detailed description
item, so it can be treated in the same way, including all formatting and other specifics
such as links generation. In most cases, at last one paragraph subitem is contained as
the child item.

@param item The member item which warning description to get.
@return Returns the warning item of the given member or @c nil if not found.
@exception NSException Thrown if extraction fails.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberBugItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (id) extractObjectMemberWarningItem:(id) item;

/** Extracts the member bug item contents from the given member item.

The returned value contains the same layout as any other brief or detailed description
item, so it can be treated in the same way, including all formatting and other specifics
such as links generation. In most cases, at last one paragraph subitem is contained as
the child item.

@param item The member item which bug description to get.
@return Returns the bug item of the given member or @c nil if not found.
@exception NSException Thrown if extraction fails.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberSeeAlsoItems:
*/
- (id) extractObjectMemberBugItem:(id) item;

/** Extracts the member see also subitems from the given member item.

The returned array contains all see also items. Each item returned in the resulting
array contains the same layout as any other brief or detailed description item, so it
can be treated in the same way, including all formatting and other specifics such as
links generation.

@param item The member item which see also list to get.
@return Returns the array of items representing individual see also items or @c nil if not found.
@exception NSException Thrown if extraction fails.
@see extractObjectMemberType:
@see extractObjectMemberName:
@see extractObjectMemberSelector:
@see extractObjectMemberFile:
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberDescriptionItem:
@see extractObjectMemberSectionItems:type:
@see extractObjectMemberReturnItem:
@see extractObjectMemberWarningItem:
@see extractObjectMemberBugItem:
*/
- (NSArray*) extractObjectMemberSeeAlsoItems:(id) item;

//////////////////////////////////////////////////////////////////////////////////////////
/// @name Object member prototype parsing support
//////////////////////////////////////////////////////////////////////////////////////////

/** Extracts the member prototype subitems from the given member item.
@param item The member prototype item which subitems to return.
@return Returns the array of prototype contents or @c nil if no content is found.
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberPrototypeItemType:
@see extractObjectMemberPrototypeItemValue:
*/
- (NSArray*) extractObjectMemberPrototypeSubitems:(id) item;

/** Extracts the given member prototype item type.

This can be used over the items of the array returned from
@c extractObjectMemberPrototypeSubitems:(). Possible return values are:
- @c kTKPrototypeValue: The item represents a value.
- @c kTKPrototypeParameter: The item represents a parameter name.

To get the actual value, use @c extractObjectMemberPrototypeItemValue:() passing the
result of this method as the @c type parameter.

@param item The prototype item to check.
@return Returns the type of the given item.
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberPrototypeSubitems:
@see extractObjectMemberPrototypeItemValue:
*/
- (int) extractObjectMemberPrototypeItemType:(id) item;

/** Extracts the given prototype component value from the given prototype item.

This can be used over the items of the array returned from
@c extractObjectMemberPrototypeSubitems:().
@param item The prototype item to check.
@return Returns the string value representation of the given prototype item.
@see extractObjectMemberPrototypeItem:
@see extractObjectMemberPrototypeSubitems:
@see extractObjectMemberPrototypeItemType:
*/
- (NSString*) extractObjectMemberPrototypeItemValue:(id) item;

//////////////////////////////////////////////////////////////////////////////////////////
/// @name Parameters parsing support
//////////////////////////////////////////////////////////////////////////////////////////

/** Extracts the parameter name from the given parameter item.

@param item The parameter item which name to return.
@return Returns the parameter name or @c nil if not found.
*/
- (NSString*) extractObjectParameterName:(id) item;

/** Extracts the parameter description item from the given parameter item.

The returned item can be used by @c extractBriefDescriptionFromItem:(),
@c extractBriefDescriptionsFromItem:() and @c extractDetailDescriptionsFromItem:() to get
individual description components.

@param item The parameter item which description item to return.
@return Returns the parameter description item or @c nil if not found.
*/
- (id) extractObjectParameterDescriptionItem:(id) item;

@end
Something went wrong with that request. Please try again.