#include <ConfDataWriter.hpp>
Inheritance diagram for ConfDataWriter:


A typical way to use this class follows:
// Declare a ConfDataReader object ConfDataWriter confWriter; // Open and parse configuration file confWriter.open("configuration.txt"); confWriter.writeVariable(cutOffElevation, 10.0, "minimum allowed satellite elevation", "in degrees");
The configuration file follows the following format:
Definition at line 87 of file ConfDataWriter.hpp.
Public Member Functions | |
| ConfDataWriter () | |
| Default constructor. | |
| ConfDataWriter (const char *file) | |
| Common constructor. | |
| ConfDataWriter (const std::string &file) | |
| Common constructor. | |
| virtual void | open (const char *fn) |
| Method to open a configuration data file to be written. | |
| virtual void | open (const std::string &fn) |
| Method to open a configuration data file to be written. | |
| virtual void | writeHeader () |
| Write a common header for all of the configuration data files written by this class. | |
| void | writeCommentLine (const std::string &comment) |
| Write a comment line start by '#'. | |
| void | writeSeparatorLine (const std::string &s="-", const int &n=130) |
| Write a comment line as a separator line. | |
| void | writeBlankLine (const int &n=1) |
| Write several blank lines default write one line. | |
| void | writeVariable (const std::string &var, const std::string &val, const std::string &varComment="", const std::string &valComment="") |
| Write a string variable with general format. | |
| void | writeVariable (const std::string &var, const int &val, const std::string &varComment="", const std::string &valComment="") |
| Write a integer variable with general format. | |
| void | writeVariable (const std::string &var, const double &val, const std::string &varComment="", const std::string &valComment="") |
| Write a double variable with general format. | |
| void | writeVariableList (const std::string &var, const std::string valList[], const int &n, const std::string &varComment="", const std::string &valComment="") |
| Write a string variable list with general format. | |
| void | writeVariableList (const std::string &var, std::vector< std::string > valList, const std::string &varComment="", const std::string &valComment="") |
| Write a string variable list with general format. | |
| void | writeVariableList (const std::string &var, const int valList[], const int &n, const std::string &varComment="", const std::string &valComment="") |
| Write a int variable list with general format. | |
| void | writeVariableList (const std::string &var, const double valList[], const int &n, const std::string &varComment="", const std::string &valComment="") |
| Write a double variable list with general format. | |
| void | writeSection (const std::string &name, const std::string &comment="") |
| Write a new section with some comment. | |
| void | writeEnd () |
| Write a common tailer for all of the configuration data files written by this class. | |
| void | setVariableWidth (const int width=0) |
| Method to set the variable name with to make the output looks more neat and beauty. | |
| void | setValuePrecision (const int precision=6) |
| Method to set the precision of double variable's value to make the output looks the output looks more neat and beauty. | |
Protected Member Functions | |
| void | formattedPutLine (const std::string &sline) |
| Write a string line to the file. | |
Protected Attributes | |
| int | variableWidth |
| int | valuePrecison |
|
|
Default constructor.
Definition at line 92 of file ConfDataWriter.hpp. |
|
|
Common constructor. It will always open 'file' for read and will configuration data in one pass.
Definition at line 101 of file ConfDataWriter.hpp. |
|
|
Common constructor. It will always open 'fn' for read and will configuration data in one pass.
Definition at line 112 of file ConfDataWriter.hpp. |
|
|
Write a string line to the file.
Definition at line 284 of file ConfDataWriter.cpp. Referenced by ConfDataWriter::writeBlankLine(), ConfDataWriter::writeCommentLine(), ConfDataWriter::writeSection(), ConfDataWriter::writeVariable(), and ConfDataWriter::writeVariableList(). |
|
|
Method to open a configuration data file to be written.
Definition at line 122 of file ConfDataWriter.hpp. |
|
|
Method to open a configuration data file to be written.
Definition at line 40 of file ConfDataWriter.cpp. References ConfDataWriter::writeHeader(). |
|
|
Method to set the precision of double variable's value to make the output looks the output looks more neat and beauty.
Definition at line 260 of file ConfDataWriter.hpp. Referenced by ConfData::save(). |
|
|
Method to set the variable name with to make the output looks more neat and beauty.
Definition at line 255 of file ConfDataWriter.hpp. Referenced by ConfData::save(). |
|
|
Write several blank lines default write one line.
Definition at line 80 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(). Referenced by ConfData::save(), and ConfDataWriter::writeEnd(). |
|
|
Write a comment line start by '#'.
Definition at line 64 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(). Referenced by ConfData::save(), ConfDataWriter::writeEnd(), ConfDataWriter::writeSection(), and ConfDataWriter::writeSeparatorLine(). |
|
|
Write a common tailer for all of the configuration data files written by this class.
Definition at line 273 of file ConfDataWriter.cpp. References ConfDataWriter::writeBlankLine(), ConfDataWriter::writeCommentLine(), and ConfDataWriter::writeSeparatorLine(). Referenced by ConfData::save(). |
|
|
Write a common header for all of the configuration data files written by this class.
Definition at line 50 of file ConfDataWriter.cpp. Referenced by ConfDataWriter::open(). |
|
||||||||||||
|
Write a new section with some comment.
Definition at line 252 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(), ConfDataWriter::writeCommentLine(), and ConfDataWriter::writeSeparatorLine(). Referenced by ConfData::save(). |
|
||||||||||||
|
Write a comment line as a separator line.
Definition at line 73 of file ConfDataWriter.cpp. References ConfDataWriter::writeCommentLine(). Referenced by ConfData::save(), ConfDataWriter::writeEnd(), and ConfDataWriter::writeSection(). |
|
||||||||||||||||||||
|
Write a double variable with general format.
Definition at line 122 of file ConfDataWriter.cpp. References ConfDataWriter::valuePrecison, and ConfDataWriter::writeVariable(). |
|
||||||||||||||||||||
|
Write a integer variable with general format.
Definition at line 162 of file ConfDataWriter.hpp. |
|
||||||||||||||||||||
|
Write a string variable with general format.
Definition at line 96 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(), gpstk::StringUtils::leftJustify(), and ConfDataWriter::variableWidth. Referenced by ConfData::save(), and ConfDataWriter::writeVariable(). |
|
||||||||||||||||||||||||
|
Write a double variable list with general format.
Definition at line 231 of file ConfDataWriter.cpp. References ConfDataWriter::valuePrecison, and ConfDataWriter::writeVariableList(). |
|
||||||||||||||||||||||||
|
Write a int variable list with general format.
Definition at line 208 of file ConfDataWriter.cpp. References ConfDataWriter::writeVariableList(). |
|
||||||||||||||||||||
|
Write a string variable list with general format.
|
|
||||||||||||||||||||||||
|
Write a string variable list with general format.
Definition at line 141 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(), gpstk::StringUtils::leftJustify(), and ConfDataWriter::variableWidth. Referenced by ConfDataWriter::writeVariableList(). |
|
|
Definition at line 270 of file ConfDataWriter.hpp. Referenced by ConfDataWriter::writeVariable(), and ConfDataWriter::writeVariableList(). |
|
|
Definition at line 268 of file ConfDataWriter.hpp. Referenced by ConfDataWriter::writeVariable(), and ConfDataWriter::writeVariableList(). |
1.3.9.1