A Discrete-Event Network Simulator
API
xml-config.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@cutebugs.net>
19  */
20 
21 #ifndef XML_CONFIG_STORE_H
22 #define XML_CONFIG_STORE_H
23 
24 #include <string>
25 #include <libxml/xmlwriter.h>
26 #include <libxml/xmlreader.h>
27 #include "file-config.h"
28 
29 namespace ns3 {
30 
36 class XmlConfigSave : public FileConfig
37 {
38 public:
39  XmlConfigSave ();
40  virtual ~XmlConfigSave ();
41 
42  virtual void SetFilename (std::string filename);
43  virtual void Default (void);
44  virtual void Global (void);
45  virtual void Attributes (void);
46 private:
47  xmlTextWriterPtr m_writer;
48 };
49 
54 class XmlConfigLoad : public FileConfig
55 {
56 public:
57  XmlConfigLoad ();
58  virtual ~XmlConfigLoad ();
59 
60  virtual void SetFilename (std::string filename);
61  virtual void Default (void);
62  virtual void Global (void);
63  virtual void Attributes (void);
64 private:
65  std::string m_filename;
66 };
67 
68 } // namespace ns3
69 
70 #endif /* XML_CONFIG_STORE_H */
base class for ConfigStore classes using files
Definition: file-config.h:34
A class to enable loading of configuration store from an XML file.
Definition: xml-config.h:55
virtual void SetFilename(std::string filename)
Set the file name.
Definition: xml-config.cc:297
virtual void Attributes(void)
Load or save the attributes values.
Definition: xml-config.cc:379
virtual void Default(void)
Load or save the default values.
Definition: xml-config.cc:303
virtual ~XmlConfigLoad()
Definition: xml-config.cc:291
std::string m_filename
the file name
Definition: xml-config.h:65
virtual void Global(void)
Load or save the global values.
Definition: xml-config.cc:341
A class to enable saving of configuration store in an XML file.
Definition: xml-config.h:37
virtual void Attributes(void)
Load or save the attributes values.
Definition: xml-config.cc:180
virtual ~XmlConfigSave()
Definition: xml-config.cc:79
virtual void Global(void)
Load or save the global values.
Definition: xml-config.cc:254
xmlTextWriterPtr m_writer
XML writer.
Definition: xml-config.h:47
virtual void SetFilename(std::string filename)
Set the file name.
Definition: xml-config.cc:42
virtual void Default(void)
Load or save the default values.
Definition: xml-config.cc:101
Every class exported by the ns3 library is enclosed in the ns3 namespace.