/usr/include/GNUstep/Foundation/NSXMLParser.h is in libgnustep-base-dev 1.22.1-4+deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | /** Interface for NSXMLParser for GNUStep
Copyright (C) 2004 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
Date: May 2004
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02111 USA.
AutogsdocSource: NSXMLParser.m
*/
#ifndef __NSXMLParser_h_GNUSTEP_BASE_INCLUDE
#define __NSXMLParser_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(100300, GS_API_LATEST)
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSData, NSDictionary, NSError, NSString, NSURL;
/**
* Domain for errors
*/
GS_EXPORT NSString* const NSXMLParserErrorDomain;
/**
* This class is a PRE-ALPHA implementation. You should be prepared to
* track down and fix bugs and preferably contribute fixes back.<br />
* If you don't want to do that, use the [GSXMLParser] class instead ...
* This NSXMLParser class is implemented as a wrapper round some of the
* functionality of the more powerful GSXML APIs, and is intended as a
* MacOSX compatibility feature.
* <p>
* This class implements an event driven parser handling the parsing
* process by sending messages to a delegate when certain parts of the
* XML document being parsed are encountered.
* </p>
* <p>
* To use the class, you create and initialise an instance with a particular
* XML document, set the delegate of the instance, and send a -parse message
* to it. The delegate must then make use of the information it receives
* in the messages it gets from the parser.
* </p>
* <p>
* The [NSObject(NSXMLParserDelegateEventAdditions)] informal protocol
* documents the methods which the delegate object may implement in order
* to handle the parsing process.
* </p>
*/
@interface NSXMLParser : NSObject
{
#if GS_EXPOSE(NSXMLParser)
@public
void *_parser; // GSXMLParser
void *_handler; // SAXHandler
#endif
#if GS_NONFRAGILE
#else
/* Pointer to private additional data used to avoid breaking ABI
* when we don't have the non-fragile ABI available.
* Use this mechanism rather than changing the instance variable
* layout (see Source/GSInternal.h for details).
*/
@private id _internal GS_UNUSED_IVAR;
#endif
}
/**
* Terminates the current parse operation and sends an error to the
* delegate of the parser.
*/
- (void) abortParsing;
/**
* Returns the delegate previously set using -setDelegate: or nil if
* no delegate is set.
*/
- (id) delegate;
/**
* Convenience method fetching data from anURL.<br />
*/
- (id) initWithContentsOfURL: (NSURL*)anURL;
/** <init />
* Initialises the parser with the specified xml data.
*/
- (id) initWithData: (NSData*)data;
/**
* Parses the supplied data and returns YES on success, NO otherwise.
*/
- (BOOL) parse;
/**
* Returns the last error produced by parsing (if any).
*/
- (NSError*) parserError;
/**
* Sets the parser delegate (which is not retained).
*/
- (void) setDelegate: (id)delegate;
/**
* Set flag to determine whether the namespaceURI and the qualified name
* of an element is provided in the
* [NSObject(NSXMLParserDelegateEventAdditions)-parser:didStartElement:namespaceURI:qualifiedName:attributes:]
* and [NSObject(NSXMLParserDelegateEventAdditions)-parser:didEndElement:namespaceURI:qualifiedName:] methods.
*/
- (void) setShouldProcessNamespaces: (BOOL)aFlag;
/**
* Sets a flag to specify whether the parser should call the
* [NSObject(NSXMLParserDelegateEventAdditions)-parser:didStartMappingPrefix:toURI:] and
* [NSObject(NSXMLParserDelegateEventAdditions)-parser:didEndMappingPrefix:] delegate methods.
*/
- (void) setShouldReportNamespacePrefixes: (BOOL)aFlag;
/**
* Sets flag to determine if declarations of external entities are
* reported using
* [NSObject(NSXMLParserDelegateEventAdditions)-parser:foundExternalEntityDeclarationWithName:publicID:systemID:]
*/
- (void) setShouldResolveExternalEntities: (BOOL)aFlag;
/**
* Returns the value set by -setShouldProcessNamespaces:
*/
- (BOOL) shouldProcessNamespaces;
/**
* Returns the value set by -setShouldReportNamespacePrefixes:
*/
- (BOOL) shouldReportNamespacePrefixes;
/**
* Returns the value set by -setShouldResolveExternalEntities:
*/
- (BOOL) shouldResolveExternalEntities;
@end
@interface NSXMLParser (NSXMLParserLocatorAdditions)
/**
* Returns the current column number of the document being parsed.
*/
- (NSInteger) columnNumber;
/**
* Returns the current line number of the document being parsed.
*/
- (NSInteger) lineNumber;
/**
* Returns the public identifier of the external entity in the
* document being parsed.
*/
- (NSString*) publicID;
/**
* Returns the system identifier of the external entity in the
* document being parsed.
*/
- (NSString*) systemID;
@end
/**
* Methods implemented by a delegate in order to make use of the parser.<br />
* This is an informal protocol.
*/
@interface NSObject (NSXMLParserDelegateEventAdditions)
/** <override-dummy />
*/
- (NSData*) parser: (NSXMLParser*)aParser
resolveExternalEntityName: (NSString*)aName
systemID: (NSString*)aSystemID;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
didEndElement: (NSString*)anElementName
namespaceURI: (NSString*)aNamespaceURI
qualifiedName: (NSString*)aQualifierName;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
didEndMappingPrefix: (NSString*)aPrefix;
/** <override-dummy />
* Called when the start of an element is encountered in the document,
* this provides the name of the element, a dictionary containing the
* attributes (if any) and (where namespaces are used) the namespace
* information for the element.
*/
- (void) parser: (NSXMLParser*)aParser
didStartElement: (NSString*)anElementName
namespaceURI: (NSString*)aNamespaceURI
qualifiedName: (NSString*)aQualifierName
attributes: (NSDictionary*)anAttributeDict;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
didStartMappingPrefix: (NSString*)aPrefix
toURI: (NSString*)aNamespaceURI;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundAttributeDeclarationWithName: (NSString*)anAttributeName
forElement: (NSString*)anElementName
type: (NSString*)aType
defaultValue: (NSString*)aDefaultValue;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundCDATA: (NSData*)aBlock;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundCharacters: (NSString*)aString;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundComment: (NSString*)aComment;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundElementDeclarationWithName: (NSString*)anElementName
model: (NSString*)aModel;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundExternalEntityDeclarationWithName: (NSString*)aName
publicID: (NSString*)aPublicID
systemID: (NSString*)aSystemID;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundIgnorableWhitespace: (NSString*)aWhitespaceString;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundInternalEntityDeclarationWithName: (NSString*)aName
value: (NSString*)aValue;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundNotationDeclarationWithName: (NSString*)aName
publicID: (NSString*)aPublicID
systemID: (NSString*)aSystemID;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundProcessingInstructionWithTarget: (NSString*)aTarget
data: (NSString*)aData;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
foundUnparsedEntityDeclarationWithName: (NSString*)aName
publicID: (NSString*)aPublicID
systemID: (NSString*)aSystemID
notationName: (NSString*)aNotationName;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
parseErrorOccurred: (NSError*)anError;
/** <override-dummy />
*/
- (void) parser: (NSXMLParser*)aParser
validationErrorOccurred: (NSError*)anError;
/** <override-dummy />
* Called when parsing ends.
*/
- (void) parserDidEndDocument: (NSXMLParser*)aParser;
/** <override-dummy />
* Called when parsing begins.
*/
- (void) parserDidStartDocument: (NSXMLParser*)aParser;
@end
/*
* Provide the same error codes as MacOS-X, even if we don't use them all.
*/
enum {
NSXMLParserInternalError = 1,
NSXMLParserOutOfMemoryError = 2,
NSXMLParserDocumentStartError = 3,
NSXMLParserEmptyDocumentError = 4,
NSXMLParserPrematureDocumentEndError = 5,
NSXMLParserInvalidHexCharacterRefError = 6,
NSXMLParserInvalidDecimalCharacterRefError = 7,
NSXMLParserInvalidCharacterRefError = 8,
NSXMLParserInvalidCharacterError = 9,
NSXMLParserCharacterRefAtEOFError = 10,
NSXMLParserCharacterRefInPrologError = 11,
NSXMLParserCharacterRefInEpilogError = 12,
NSXMLParserCharacterRefInDTDError = 13,
NSXMLParserEntityRefAtEOFError = 14,
NSXMLParserEntityRefInPrologError = 15,
NSXMLParserEntityRefInEpilogError = 16,
NSXMLParserEntityRefInDTDError = 17,
NSXMLParserParsedEntityRefAtEOFError = 18,
NSXMLParserParsedEntityRefInPrologError = 19,
NSXMLParserParsedEntityRefInEpilogError = 20,
NSXMLParserParsedEntityRefInInternalSubsetError = 21,
NSXMLParserEntityReferenceWithoutNameError = 22,
NSXMLParserEntityReferenceMissingSemiError = 23,
NSXMLParserParsedEntityRefNoNameError = 24,
NSXMLParserParsedEntityRefMissingSemiError = 25,
NSXMLParserUndeclaredEntityError = 26,
NSXMLParserUnparsedEntityError = 28,
NSXMLParserEntityIsExternalError = 29,
NSXMLParserEntityIsParameterError = 30,
NSXMLParserUnknownEncodingError = 31,
NSXMLParserEncodingNotSupportedError = 32,
NSXMLParserStringNotStartedError = 33,
NSXMLParserStringNotClosedError = 34,
NSXMLParserNamespaceDeclarationError = 35,
NSXMLParserEntityNotStartedError = 36,
NSXMLParserEntityNotFinishedError = 37,
NSXMLParserLessThanSymbolInAttributeError = 38,
NSXMLParserAttributeNotStartedError = 39,
NSXMLParserAttributeNotFinishedError = 40,
NSXMLParserAttributeHasNoValueError = 41,
NSXMLParserAttributeRedefinedError = 42,
NSXMLParserLiteralNotStartedError = 43,
NSXMLParserLiteralNotFinishedError = 44,
NSXMLParserCommentNotFinishedError = 45,
NSXMLParserProcessingInstructionNotStartedError = 46,
NSXMLParserProcessingInstructionNotFinishedError = 47,
NSXMLParserNotationNotStartedError = 48,
NSXMLParserNotationNotFinishedError = 49,
NSXMLParserAttributeListNotStartedError = 50,
NSXMLParserAttributeListNotFinishedError = 51,
NSXMLParserMixedContentDeclNotStartedError = 52,
NSXMLParserMixedContentDeclNotFinishedError = 53,
NSXMLParserElementContentDeclNotStartedError = 54,
NSXMLParserElementContentDeclNotFinishedError = 55,
NSXMLParserXMLDeclNotStartedError = 56,
NSXMLParserXMLDeclNotFinishedError = 57,
NSXMLParserConditionalSectionNotStartedError = 58,
NSXMLParserConditionalSectionNotFinishedError = 59,
NSXMLParserExternalSubsetNotFinishedError = 60,
NSXMLParserDOCTYPEDeclNotFinishedError = 61,
NSXMLParserMisplacedCDATAEndStringError = 62,
NSXMLParserCDATANotFinishedError = 63,
NSXMLParserMisplacedXMLDeclarationError = 64,
NSXMLParserSpaceRequiredError = 65,
NSXMLParserSeparatorRequiredError = 66,
NSXMLParserNMTOKENRequiredError = 67,
NSXMLParserNAMERequiredError = 68,
NSXMLParserPCDATARequiredError = 69,
NSXMLParserURIRequiredError = 70,
NSXMLParserPublicIdentifierRequiredError = 71,
NSXMLParserLTRequiredError = 72,
NSXMLParserGTRequiredError = 73,
NSXMLParserLTSlashRequiredError = 74,
NSXMLParserEqualExpectedError = 75,
NSXMLParserTagNameMismatchError = 76,
NSXMLParserUnfinishedTagError = 77,
NSXMLParserStandaloneValueError = 78,
NSXMLParserInvalidEncodingNameError = 79,
NSXMLParserCommentContainsDoubleHyphenError = 80,
NSXMLParserInvalidEncodingError = 81,
NSXMLParserExternalStandaloneEntityError = 82,
NSXMLParserInvalidConditionalSectionError = 83,
NSXMLParserEntityValueRequiredError = 84,
NSXMLParserNotWellBalancedError = 85,
NSXMLParserExtraContentError = 86,
NSXMLParserInvalidCharacterInEntityError = 87,
NSXMLParserParsedEntityRefInInternalError = 88,
NSXMLParserEntityRefLoopError = 89,
NSXMLParserEntityBoundaryError = 90,
NSXMLParserInvalidURIError = 91,
NSXMLParserURIFragmentError = 92,
NSXMLParserNoDTDError = 94,
NSXMLParserDelegateAbortedParseError = 512
};
typedef NSUInteger NSXMLParserError;
#if defined(__cplusplus)
}
#endif
#endif
#endif /* __NSXMLParser_h_GNUSTEP_BASE_INCLUDE */
|