A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
xml-config.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@cutebugs.net>
7 */
8
9#ifndef XML_CONFIG_STORE_H
10#define XML_CONFIG_STORE_H
11
12#include "file-config.h"
13
14#include <string>
15
16// These are in #include <libxml/xmlwriter.h>,
17// here we just need a forward declaration.
18typedef struct _xmlTextWriter xmlTextWriter;
20
21namespace ns3
22{
23
24/**
25 * \ingroup configstore
26 * \brief A class to enable saving of configuration store in an XML file
27 *
28 */
30{
31 public:
33 ~XmlConfigSave() override;
34
35 void SetFilename(std::string filename) override;
36 void Default() override;
37 void Global() override;
38 void Attributes() override;
39
40 private:
41 xmlTextWriterPtr m_writer; ///< XML writer
42};
43
44/**
45 * \ingroup configstore
46 * \brief A class to enable loading of configuration store from an XML file
47 */
49{
50 public:
52 ~XmlConfigLoad() override;
53
54 void SetFilename(std::string filename) override;
55 void Default() override;
56 void Global() override;
57 void Attributes() override;
58
59 private:
60 std::string m_filename; ///< the file name
61};
62
63} // namespace ns3
64
65#endif /* XML_CONFIG_STORE_H */
base class for ConfigStore classes using files
Definition file-config.h:23
A class to enable loading of configuration store from an XML file.
Definition xml-config.h:49
void Global() override
Load or save the global values.
void SetFilename(std::string filename) override
Set the file name.
void Default() override
Load or save the default values.
std::string m_filename
the file name
Definition xml-config.h:60
void Attributes() override
Load or save the attributes values.
~XmlConfigLoad() override
A class to enable saving of configuration store in an XML file.
Definition xml-config.h:30
void Global() override
Load or save the global values.
void Attributes() override
Load or save the attributes values.
~XmlConfigSave() override
Definition xml-config.cc:74
xmlTextWriterPtr m_writer
XML writer.
Definition xml-config.h:41
void SetFilename(std::string filename) override
Set the file name.
Definition xml-config.cc:36
void Default() override
Load or save the default values.
Definition xml-config.cc:97
Every class exported by the ns3 library is enclosed in the ns3 namespace.
struct _xmlTextWriter xmlTextWriter
Definition xml-config.h:18
xmlTextWriter * xmlTextWriterPtr
Definition xml-config.h:19