Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes

OFXMLParser Class Reference

An event-based XML parser. More...

#import <OFXMLParser.h>

Inheritance diagram for OFXMLParser:
OFObject <OFStringXMLUnescapingDelegate>

List of all members.

Public Member Functions

(id< OFXMLParserDelegate >) - delegate
(void) - setDelegate:
(void) - parseBuffer:withSize:
(void) - parseString:
(void) - parseStream:
(void) - parseFile:
(size_t) - lineNumber
(BOOL) - finishedParsing

Static Public Member Functions

(id) + parser

Protected Types

enum  {
  OF_XMLPARSER_OUTSIDE_TAG, OF_XMLPARSER_TAG_OPENED, OF_XMLPARSER_IN_PROCESSING_INSTRUCTIONS, OF_XMLPARSER_IN_TAG_NAME,
  OF_XMLPARSER_IN_CLOSE_TAG_NAME, OF_XMLPARSER_IN_TAG, OF_XMLPARSER_IN_ATTR_NAME, OF_XMLPARSER_EXPECT_DELIM,
  OF_XMLPARSER_IN_ATTR_VALUE, OF_XMLPARSER_EXPECT_CLOSE, OF_XMLPARSER_EXPECT_SPACE_OR_CLOSE, OF_XMLPARSER_IN_EXCLAMATIONMARK,
  OF_XMLPARSER_IN_CDATA_OPENING, OF_XMLPARSER_IN_CDATA_1, OF_XMLPARSER_IN_CDATA_2, OF_XMLPARSER_IN_COMMENT_OPENING,
  OF_XMLPARSER_IN_COMMENT_1, OF_XMLPARSER_IN_COMMENT_2, OF_XMLPARSER_IN_DOCTYPE, OF_XMLPARSER_NUM_STATES
}

Protected Attributes

id< OFXMLParserDelegatedelegate
enum OFXMLParser:: { ... }  state
OFMutableStringcache
OFStringname
OFStringprefix
OFMutableArraynamespaces
OFMutableArrayattrs
OFStringattrName
OFStringattrPrefix
char delim
OFMutableArrayprevious
size_t level
size_t lineNumber
BOOL lastCarriageReturn
BOOL finishedParsing

Detailed Description

An event-based XML parser.

OFXMLParser is an event-based XML parser which calls the delegate's callbacks as soon asit finds something, thus suitable for streams as well.


Member Function Documentation

- (id <OFXMLParserDelegate>) delegate  
Returns:
The delegate that is used by the XML parser
- (BOOL) finishedParsing  
Returns:
Whether the XML parser has finished parsing
- (size_t) lineNumber  
Returns:
The current line number
- (void) parseBuffer: (const char*)  buf
withSize: (size_t)  size 

Parses a buffer with the specified size.

Parameters:
buf The buffer to parse
size The size of the buffer
- (void) parseFile: (OFString*)  path  

Parses the specified file.

Parameters:
path The path to the file to parse
+ (id) parser  
Returns:
A new, autoreleased OFXMLParser
- (void) parseStream: (OFStream*)  stream  

Parses the specified stream.

Parameters:
stream The stream to parse
- (void) parseString: (OFString*)  str  

Parses the specified string.

Parameters:
str The string to parse
- (void) setDelegate: (id <OFXMLParserDelegate>)  delegate  

Sets the delegate the OFXMLParser should use.

Parameters:
delegate The delegate to use

The documentation for this class was generated from the following files:
 All Classes Functions Variables