A Discrete-Event Network Simulator
API
raw-text-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 RAW_TEXT_CONFIG_H
22 #define RAW_TEXT_CONFIG_H
23 
24 #include <string>
25 #include <fstream>
26 #include "file-config.h"
27 
28 namespace ns3 {
29 
36 {
37 public:
39  virtual ~RawTextConfigSave ();
40  virtual void SetFilename (std::string filename);
41  virtual void Default (void);
42  virtual void Global (void);
43  virtual void Attributes (void);
44 private:
46  std::ofstream *m_os;
47 };
48 
55 {
56 public:
58  virtual ~RawTextConfigLoad ();
59  virtual void SetFilename (std::string filename);
60  virtual void Default (void);
61  virtual void Global (void);
62  virtual void Attributes (void);
63 private:
69  std::string Strip (std::string value);
71  std::ifstream *m_is;
72 };
73 
74 } // namespace ns3
75 
76 #endif /* RAW_TEXT_CONFIG_H */
A class to enable saving of configuration store in a raw text file.
virtual void Attributes(void)
Load or save the attributes values.
virtual void SetFilename(std::string filename)
Set the file name.
virtual void SetFilename(std::string filename)
Set the file name.
base class for ConfigStore classes using files
Definition: file-config.h:33
virtual void Global(void)
Load or save the global values.
std::string Strip(std::string value)
Strip out attribute value.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void Attributes(void)
Load or save the attributes values.
virtual void Default(void)
Load or save the default values.
std::ofstream * m_os
Config store output stream.
std::ifstream * m_is
Config store input stream.
virtual void Global(void)
Load or save the global values.
A class to enable loading of configuration store from a raw text file.
virtual void Default(void)
Load or save the default values.