Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes

XMLFile Class Reference

Base class for loading/storing XML files that have a handler derived from XMLHandler. More...

#include <OpenMS/FORMAT/XMLFile.h>

Inheritance diagram for XMLFile:
ConsensusXMLFile CVMappingFile FeatureXMLFile IdXMLFile SemanticValidator MascotXMLFile MzDataFile MzIdentMLFile MzMLFile MzQuantMLFile MzXMLFile OMSSAXMLFile ParamXMLFile PepXMLFile PepXMLFileMascot ProtXMLFile PTMXMLFile QcMLFile ToolDescriptionFile TraMLFile TransformationXMLFile UnimodXMLFile XTandemInfile XTandemXMLFile

List of all members.

Public Member Functions

 XMLFile ()
 Default constructor.
 XMLFile (const String &schema_location, const String &version)
 Constructor that sets the schema location.
virtual ~XMLFile ()
 Destructor.
bool isValid (const String &filename, std::ostream &os=std::cerr)
 Checks if a file validates against the XML schema.
const StringgetVersion () const
 return the version of the schema

Protected Member Functions

void parse_ (const String &filename, XMLHandler *handler)
 Parses the XML file given by filename using the handler given by handler.
void save_ (const String &filename, XMLHandler *handler) const
 Stores the contents of the XML handler given by handler in the file given by filename.
void enforceEncoding_ (const String &encoding)

Protected Attributes

String schema_location_
 XML schema file location.
String schema_version_
 Version string.
String enforced_encoding_
 Encoding string that replaces the encoding (system dependend or specified in the XML). Disabled if empty. Used as a workaround for XTandem output xml.

Detailed Description

Base class for loading/storing XML files that have a handler derived from XMLHandler.


Constructor & Destructor Documentation

XMLFile (  ) 

Default constructor.

XMLFile ( const String schema_location,
const String version 
)

Constructor that sets the schema location.

virtual ~XMLFile (  )  [virtual]

Destructor.


Member Function Documentation

void enforceEncoding_ ( const String encoding  )  [protected]
const String& getVersion (  )  const

return the version of the schema

bool isValid ( const String filename,
std::ostream &  os = std::cerr 
)

Checks if a file validates against the XML schema.

Error messages are printed to the error stream, unless redirected with the attribute os .

Exceptions:
Exception::FileNotFound is thrown if the file cannot be found
Exception::NotImplemented is thrown if there is no schema available for the file type
void parse_ ( const String filename,
XMLHandler handler 
) [protected]

Parses the XML file given by filename using the handler given by handler.

Exceptions:
Exception::FileNotFound is thrown if the file is not found
Exception::ParseError is thrown if an error occurred during the parsing
void save_ ( const String filename,
XMLHandler handler 
) const [protected]

Stores the contents of the XML handler given by handler in the file given by filename.

Exceptions:
Exception::UnableToCreateFile is thrown if the file cannot be created

Member Data Documentation

Encoding string that replaces the encoding (system dependend or specified in the XML). Disabled if empty. Used as a workaround for XTandem output xml.

String schema_location_ [protected]

XML schema file location.

String schema_version_ [protected]

Version string.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:43:00 using doxygen 1.7.1