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

Public Member Functions

 SecondHandler (Second &object, bool autoUnescapeAttributes, bool autoUnescapeCharacters)
 
virtual Status startElement (const string &name, const Handler::Attributes &attributes, stream_offset position)
 
virtual Status characters (const SAXParser::saxstring &text, 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)
 
 Handler ()
 
virtual ~Handler ()
 

Private Attributes

Secondobject_
 

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 231 of file SAXParserTest.cpp.

Constructor & Destructor Documentation

§ SecondHandler()

SecondHandler::SecondHandler ( Second object,
bool  autoUnescapeAttributes,
bool  autoUnescapeCharacters 
)
inline

Definition at line 235 of file SAXParserTest.cpp.

236  : object_(object)
237  {
238  parseCharacters = true;
241  }
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

Member Function Documentation

§ startElement()

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

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

Definition at line 243 of file SAXParserTest.cpp.

References readAttribute(), and unit_assert.

246  {
247  if (name == "SecondElement")
248  {
249  readAttribute(attributes, "param2", object_.param2);
250  readAttribute(attributes, "param3", object_.param3);
251  // long as we're here, verify copyability of Handler::Attributes
252  Handler::Attributes *copy1 = new Handler::Attributes(attributes);
253  Handler::Attributes copy2(*copy1);
254  delete copy1;
255  std::string str;
256  readAttribute(copy2, "param2", str);
257  unit_assert(str==object_.param2);
258  }
259 
260  return Status::Ok;
261  }
string param3
string param2
void readAttribute(const Handler::Attributes &attributes, const string &attributeName, string &result)
#define unit_assert(x)
Definition: unit.hpp:85

§ characters()

virtual Status SecondHandler::characters ( const SAXParser::saxstring text,
stream_offset  position 
)
inlinevirtual

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

Definition at line 263 of file SAXParserTest.cpp.

References pwiz::minimxml::SAXParser::saxstring::c_str().

264  {
265  object_.text.push_back(text.c_str());
266  return Status::Ok;
267  }
vector< string > text

Member Data Documentation

§ object_

Second& SecondHandler::object_
private

Definition at line 270 of file SAXParserTest.cpp.


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