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 <libxml/xmlreader.h>
26#include <libxml/xmlwriter.h>
27#include <string>
28
29namespace ns3
30{
31
38{
39 public:
41 ~XmlConfigSave() override;
42
43 void SetFilename(std::string filename) override;
44 void Default() override;
45 void Global() override;
46 void Attributes() override;
47
48 private:
49 xmlTextWriterPtr m_writer;
50};
51
57{
58 public:
60 ~XmlConfigLoad() override;
61
62 void SetFilename(std::string filename) override;
63 void Default() override;
64 void Global() override;
65 void Attributes() override;
66
67 private:
68 std::string m_filename;
69};
70
71} // namespace ns3
72
73#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:57
void Global() override
Load or save the global values.
Definition: xml-config.cc:361
void SetFilename(std::string filename) override
Set the file name.
Definition: xml-config.cc:315
void Default() override
Load or save the default values.
Definition: xml-config.cc:322
std::string m_filename
the file name
Definition: xml-config.h:68
void Attributes() override
Load or save the attributes values.
Definition: xml-config.cc:400
~XmlConfigLoad() override
Definition: xml-config.cc:309
A class to enable saving of configuration store in an XML file.
Definition: xml-config.h:38
void Global() override
Load or save the global values.
Definition: xml-config.cc:272
void Attributes() override
Load or save the attributes values.
Definition: xml-config.cc:192
~XmlConfigSave() override
Definition: xml-config.cc:84
xmlTextWriterPtr m_writer
XML writer.
Definition: xml-config.h:49
void SetFilename(std::string filename) override
Set the file name.
Definition: xml-config.cc:46
void Default() override
Load or save the default values.
Definition: xml-config.cc:107
Every class exported by the ns3 library is enclosed in the ns3 namespace.