QtXMLController.cxx
Go to the documentation of this file.
1 
11 #include "QtXMLController.h"
12 
13 #include "QtXmlDocument.h"
14 
15 #include <qfile.h>
16 
17 using std::string;
18 
19 namespace hippodraw {
20 
21 QtXMLController * QtXMLController::s_instance = 0;
22 
24 {
25 }
26 
28 {
29  if ( s_instance == 0 ) {
30  s_instance = new QtXMLController ();
31  }
32  return s_instance;
33 }
34 
35 bool
37 fileExists ( const std::string & filename ) const
38 {
39  QFile file ( filename.c_str() );
40 
41  return file.exists ();
42 }
43 
44 void
46 newDocument ( const std::string & name )
47 {
48 // if ( m_xml_doc != 0 ) delete m_xml_doc;
49  m_xml_doc = new QtXmlDocument ( name );
50 }
51 
52 } // namespace hippodraw
53 
virtual bool fileExists(const std::string &filename) const
Returns true if the specified file exists.
exists() const
QtXMLController()
A default constructor for avoiding creation except by itself or with derived classes.
static QtXMLController * s_instance
The pointer to the singleton object.
An XML DOM Document handler using the Qt XML module.
Definition: QtXmlDocument.h:30
A singleton class that is does XML serialization and deserialization with Qt XML module.
static XmlDocument * m_xml_doc
The current document being generated or read.
virtual void newDocument(const std::string &name)
Creates a new document.
QtXmlDocument class interface.
static QtXMLController * instance()
Returns the pointer to the singleton instance.

Generated for HippoDraw Class Library by doxygen