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.
 
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.
 
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
 
- 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 }
FifthHandler fifthHandler_
FirstHandler firstHandler_
SecondHandler secondHandler_
bool parseCharacters
When false, no calls to characters() will be made.
bool autoUnescapeAttributes
Setting these to false will disable the auto-unescaping feature of the parser; this is useful for han...
First first
Second second
Fifth fifth

References pwiz::minimxml::SAXParser::Handler::autoUnescapeAttributes, pwiz::minimxml::SAXParser::Handler::autoUnescapeCharacters, and pwiz::minimxml::SAXParser::Handler::parseCharacters.

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.

333 {
334 if (name == "RootElement")
335 {
336 readAttribute(attributes, "param", object_.param);
337 unit_assert_operator_equal(54, position);
338 }
339 else if (name == "FirstElement")
340 {
341 // delegate handling to a FirstHandler
342 unit_assert_operator_equal(86, position);
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 }
void readAttribute(const Handler::Attributes &attributes, const string &attributeName, string &result)
string param
#define unit_assert_operator_equal(expected, actual)
Definition unit.hpp:92

References fifthHandler_, firstHandler_, object_, Root::param, readAttribute(), secondHandler_, and unit_assert_operator_equal.

Member Data Documentation

◆ object_

Root& RootHandler::object_
private

Definition at line 360 of file SAXParserTest.cpp.

Referenced by startElement().

◆ firstHandler_

FirstHandler RootHandler::firstHandler_
private

Definition at line 361 of file SAXParserTest.cpp.

Referenced by startElement().

◆ secondHandler_

SecondHandler RootHandler::secondHandler_
private

Definition at line 362 of file SAXParserTest.cpp.

Referenced by startElement().

◆ fifthHandler_

FifthHandler RootHandler::fifthHandler_
private

Definition at line 363 of file SAXParserTest.cpp.

Referenced by startElement().


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