#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 88 of file ConfDataWriter.hpp.
Public Member Functions | |
| ConfDataWriter () | |
| Default constructor. | |
| ConfDataWriter (const char *file) | |
| Common constructor. | |
| ConfDataWriter (const string &file) | |
| Common constructor. | |
| virtual void | open (const char *fn) |
| Method to open a configuration data file to be written. | |
| virtual void | open (const 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 string &comment) |
| Write a comment line start by '#'. | |
| void | writeSeparatorLine (const 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 string &var, const string &val, const string &varComment="", const string &valComment="") |
| Write a string variable with general format. | |
| void | writeVariable (const string &var, const int &val, const string &varComment="", const string &valComment="") |
| Write a integer variable with general format. | |
| void | writeVariable (const string &var, const double &val, const string &varComment="", const string &valComment="") |
| Write a double variable with general format. | |
| void | writeVariableList (const string &var, const string valList[], const int &n, const string &varComment="", const string &valComment="") |
| Write a string variable list with general format. | |
| void | writeVariableList (const string &var, vector< string > valList, const string &varComment="", const string &valComment="") |
| Write a string variable list with general format. | |
| void | writeVariableList (const string &var, const int valList[], const int &n, const string &varComment="", const string &valComment="") |
| Write a int variable list with general format. | |
| void | writeVariableList (const string &var, const double valList[], const int &n, const string &varComment="", const string &valComment="") |
| Write a double variable list with general format. | |
| void | writeSection (const string &name, const 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 string &sline) |
| Write a string line to the file. | |
Protected Attributes | |
| int | variableWidth |
| int | valuePrecison |
|
|
Default constructor.
Definition at line 93 of file ConfDataWriter.hpp. |
|
|
Common constructor. It will always open 'file' for read and will configuration data in one pass.
Definition at line 102 of file ConfDataWriter.hpp. |
|
|
Common constructor. It will always open 'fn' for read and will configuration data in one pass.
Definition at line 113 of file ConfDataWriter.hpp. |
|
|
Write a string line to the file.
Definition at line 283 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 123 of file ConfDataWriter.hpp. |
|
|
Method to open a configuration data file to be written.
Definition at line 39 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 261 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 256 of file ConfDataWriter.hpp. Referenced by ConfData::save(). |
|
|
Write several blank lines default write one line.
Definition at line 79 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(). Referenced by ConfData::save(), and ConfDataWriter::writeEnd(). |
|
|
Write a comment line start by '#'.
Definition at line 63 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 272 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 49 of file ConfDataWriter.cpp. Referenced by ConfDataWriter::open(). |
|
||||||||||||
|
Write a new section with some comment.
Definition at line 251 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 72 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 121 of file ConfDataWriter.cpp. References ConfDataWriter::valuePrecison, and ConfDataWriter::writeVariable(). |
|
||||||||||||||||||||
|
Write a integer variable with general format.
Definition at line 163 of file ConfDataWriter.hpp. |
|
||||||||||||||||||||
|
Write a string variable with general format.
Definition at line 95 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 230 of file ConfDataWriter.cpp. References ConfDataWriter::valuePrecison, and ConfDataWriter::writeVariableList(). |
|
||||||||||||||||||||||||
|
Write a int variable list with general format.
Definition at line 207 of file ConfDataWriter.cpp. References ConfDataWriter::writeVariableList(). |
|
||||||||||||||||||||
|
Write a string variable list with general format.
Definition at line 171 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(), gpstk::StringUtils::leftJustify(), and ConfDataWriter::variableWidth. |
|
||||||||||||||||||||||||
|
Write a string variable list with general format.
Definition at line 140 of file ConfDataWriter.cpp. References ConfDataWriter::formattedPutLine(), gpstk::StringUtils::leftJustify(), and ConfDataWriter::variableWidth. Referenced by ConfDataWriter::writeVariableList(). |
|
|
Definition at line 271 of file ConfDataWriter.hpp. Referenced by ConfDataWriter::writeVariable(), and ConfDataWriter::writeVariableList(). |
|
|
Definition at line 269 of file ConfDataWriter.hpp. Referenced by ConfDataWriter::writeVariable(), and ConfDataWriter::writeVariableList(). |
1.3.9.1