A Discrete-Event Network Simulator
API
xml-config.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@cutebugs.net>
18  */
19 
20 #ifndef XML_CONFIG_STORE_H
21 #define XML_CONFIG_STORE_H
22 
23 #include "file-config.h"
24 
25 #include <string>
26 
27 // These are in #include <libxml/xmlwriter.h>,
28 // here we just need a forward declaration.
29 typedef struct _xmlTextWriter xmlTextWriter;
31 
32 namespace ns3
33 {
34 
40 class XmlConfigSave : public FileConfig
41 {
42  public:
43  XmlConfigSave();
44  ~XmlConfigSave() override;
45 
46  void SetFilename(std::string filename) override;
47  void Default() override;
48  void Global() override;
49  void Attributes() override;
50 
51  private:
53 };
54 
59 class XmlConfigLoad : public FileConfig
60 {
61  public:
62  XmlConfigLoad();
63  ~XmlConfigLoad() override;
64 
65  void SetFilename(std::string filename) override;
66  void Default() override;
67  void Global() override;
68  void Attributes() override;
69 
70  private:
71  std::string m_filename;
72 };
73 
74 } // namespace ns3
75 
76 #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:60
void Global() override
Load or save the global values.
Definition: xml-config.cc:360
void SetFilename(std::string filename) override
Set the file name.
Definition: xml-config.cc:314
void Default() override
Load or save the default values.
Definition: xml-config.cc:321
std::string m_filename
the file name
Definition: xml-config.h:71
void Attributes() override
Load or save the attributes values.
Definition: xml-config.cc:399
~XmlConfigLoad() override
Definition: xml-config.cc:308
A class to enable saving of configuration store in an XML file.
Definition: xml-config.h:41
void Global() override
Load or save the global values.
Definition: xml-config.cc:271
void Attributes() override
Load or save the attributes values.
Definition: xml-config.cc:192
~XmlConfigSave() override
Definition: xml-config.cc:85
xmlTextWriterPtr m_writer
XML writer.
Definition: xml-config.h:52
void SetFilename(std::string filename) override
Set the file name.
Definition: xml-config.cc:47
void Default() override
Load or save the default values.
Definition: xml-config.cc:108
Every class exported by the ns3 library is enclosed in the ns3 namespace.
struct _xmlTextWriter xmlTextWriter
Definition: xml-config.h:29
xmlTextWriter * xmlTextWriterPtr
Definition: xml-config.h:30