ProteoWizard
Public Member Functions | Private Attributes | List of all members
RootHandler Class Reference
Inheritance diagram for RootHandler:
pwiz::minimxml::SAXParser::Handler

Public Member Functions

 RootHandler (Root &root, bool autoUnescapeAttributes=true, bool autoUnescapeCharacters=true)
 
virtual Status startElement (const string &name, const Attributes &attributes, stream_offset position)
 
- Public Member Functions inherited from pwiz::minimxml::SAXParser::Handler
virtual Status processingInstruction (const std::string &name, const std::string &data, stream_offset position)
 
virtual Status endElement (const std::string &name, stream_offset position)
 
virtual Status characters (const SAXParser::saxstring &text, stream_offset position)
 
 Handler ()
 
virtual ~Handler ()
 

Private Attributes

Rootobject_
 
FirstHandler firstHandler_
 
SecondHandler secondHandler_
 
FifthHandler fifthHandler_
 

Additional Inherited Members

- Public Types inherited from pwiz::minimxml::SAXParser::Handler
enum  XMLUnescapeBehavior_t { XMLUnescapeDefault, NoXMLUnescape }
 
typedef boost::iostreams::stream_offset stream_offset
 
- Public Attributes inherited from pwiz::minimxml::SAXParser::Handler
bool parseCharacters
 When false, no calls to characters() will be made. More...
 
bool autoUnescapeAttributes
 Setting these to false will disable the auto-unescaping feature of the parser; this is useful for handlers which deal with large amounts of data. More...
 
bool autoUnescapeCharacters
 
int version
 contextual version available to control handler logic which support multiple versions of a schema; the default value 0 indicates handler should ignore the version; the handler determines the meaning of any non-zero value More...
 
- Protected Member Functions inherited from pwiz::minimxml::SAXParser::Handler
template<typename T >
T & getAttribute (const Attributes &attributes, const char *name, T &result, XMLUnescapeBehavior_t Unescape, T defaultValue=T()) const
 
const char * getAttribute (const Attributes &attributes, const char *name, XMLUnescapeBehavior_t Unescape, const char *defaultValue=NULL) const
 
template<typename T >
T & getAttribute (const Attributes &attributes, const char *name, T &result) const
 
std::string & getAttribute (const Attributes &attributes, const char *name, std::string &result) const
 
template<typename T >
T & getAttribute (const Attributes &attributes, const std::string &name, T &result, T defaultValue=T()) const
 

Detailed Description

Definition at line 315 of file SAXParserTest.cpp.

Constructor & Destructor Documentation

§ RootHandler()

RootHandler::RootHandler ( Root root,
bool  autoUnescapeAttributes = true,
bool  autoUnescapeCharacters = true 
)
inline

Definition at line 319 of file SAXParserTest.cpp.

320  : object_(root),
324  {
325  parseCharacters = true;
328  }
SecondHandler secondHandler_
Fifth fifth
Second second
FirstHandler firstHandler_
bool parseCharacters
When false, no calls to characters() will be made.
Definition: SAXParser.hpp:320
bool autoUnescapeAttributes
Setting these to false will disable the auto-unescaping feature of the parser; this is useful for han...
Definition: SAXParser.hpp:324
First first
FifthHandler fifthHandler_

Member Function Documentation

§ startElement()

virtual Status RootHandler::startElement ( const string &  name,
const Attributes attributes,
stream_offset  position 
)
inlinevirtual

Reimplemented from pwiz::minimxml::SAXParser::Handler.

Definition at line 330 of file SAXParserTest.cpp.

References readAttribute(), and unit_assert_operator_equal.

333  {
334  if (name == "RootElement")
335  {
336  readAttribute(attributes, "param", object_.param);
338  }
339  else if (name == "FirstElement")
340  {
341  // delegate handling to a FirstHandler
343  return Status(Status::Delegate, &firstHandler_);
344  }
345  else if (name == "SecondElement")
346  {
347  // delegate handling to a SecondHandler
348  return Status(Status::Delegate, &secondHandler_);
349  }
350  else if (name == "FifthElement")
351  {
352  // delegate handling to a FifthHandler
353  return Status(Status::Delegate, &fifthHandler_);
354  }
355 
356  return Status::Ok;
357  }
SecondHandler secondHandler_
#define unit_assert_operator_equal(expected, actual)
Definition: unit.hpp:92
string param
FirstHandler firstHandler_
void readAttribute(const Handler::Attributes &attributes, const string &attributeName, string &result)
PWIZ_API_DECL Position position(CVID cvid=CVID_Unknown)
returns a Position corresponding to one of the following CVIDs: CVID_Unknown: Position::Anywhere MS_m...
FifthHandler fifthHandler_

Member Data Documentation

§ object_

Root& RootHandler::object_
private

Definition at line 360 of file SAXParserTest.cpp.

§ firstHandler_

FirstHandler RootHandler::firstHandler_
private

Definition at line 361 of file SAXParserTest.cpp.

§ secondHandler_

SecondHandler RootHandler::secondHandler_
private

Definition at line 362 of file SAXParserTest.cpp.

§ fifthHandler_

FifthHandler RootHandler::fifthHandler_
private

Definition at line 363 of file SAXParserTest.cpp.


The documentation for this class was generated from the following file: