ConfDataWriter.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef GNSSTK_CONFDATA_WRITER_HPP
45 #define GNSSTK_CONFDATA_WRITER_HPP
46 
47 #include <string>
48 #include <map>
49 #include "FFTextStream.hpp"
50 #include "StringUtils.hpp"
51 
52 
53 namespace gnsstk
54 {
55 
56 
58 
59 
100  {
101  public:
102 
106 
113  ConfDataWriter(const char* file)
114  : FFTextStream(file, std::ios::out)
115  { writeHeader(); };
116 
117 
124  ConfDataWriter(const std::string& file)
125  : FFTextStream(file.c_str(), std::ios::out)
126  { writeHeader(); };
127 
128 #pragma clang diagnostic push
129 #pragma clang diagnostic ignored "-Woverloaded-virtual"
130  virtual void open(const char* fn);
132 
133 
135  virtual void open(const std::string& fn)
136  { open( fn.c_str() ); };
137 #pragma clang diagnostic pop
138 
141  virtual void writeHeader();
142 
144  void writeCommentLine(const std::string& comment);
145 
149  void writeSeparatorLine(const std::string& s = "-",
150  const int& n = 130);
151 
153  void writeBlankLine(const int& n=1);
154 
162  void writeVariable(const std::string& var,
163  const std::string& val,
164  const std::string& varComment = "",
165  const std::string& valComment = "");
166 
167 
175  void writeVariable(const std::string& var,
176  const int& val,
177  const std::string& varComment = "",
178  const std::string& valComment = "")
179  { writeVariable(var,StringUtils::asString(val),varComment,valComment);}
180 
181 
189  void writeVariable(const std::string& var,
190  const double& val,
191  const std::string& varComment = "",
192  const std::string& valComment = "");
193 
194 
195 
204  void writeVariableList(const std::string& var,
205  const std::string valList[],
206  const int& n,
207  const std::string& varComment = "",
208  const std::string& valComment = "");
209 
210 
218  void writeVariableList(const std::string& var,
219  std::vector<std::string> valList,
220  const std::string& varComment = "",
221  const std::string& valComment = "");
222 
223 
232  void writeVariableList(const std::string& var,
233  const int valList[],
234  const int& n,
235  const std::string& varComment = "",
236  const std::string& valComment = "");
237 
238 
247  void writeVariableList(const std::string& var,
248  const double valList[],
249  const int& n,
250  const std::string& varComment = "",
251  const std::string& valComment = "");
252 
253 
259  void writeSection(const std::string& name,
260  const std::string& comment = "");
261 
264  void writeEnd();
265 
268  void setVariableWidth(const int width = 0)
269  { variableWidth = width;}
270 
273  void setValuePrecision(const int precision = 6)
274  { valuePrecison = precision;}
275 
276  protected:
277 
279  void formattedPutLine(const std::string& sline);
280 
282 
284 
285  }; // End of class 'ConfDataWriter'
286 
288 
289 } // End of namespace gnsstk
290 
291 
292 
293 #endif // GNSSTK_CONFDATA_WRITER_HPP
file
page HOWTO subpage DoxygenGuide Documenting Your Code page DoxygenGuide Documenting Your Code todo Flesh out this document section doctips Tips for Documenting When defining make sure that the prototype is identical between the cpp and hpp file
Definition: DOCUMENTING.dox:9
gnsstk::ConfDataWriter::writeVariable
void writeVariable(const std::string &var, const std::string &val, const std::string &varComment="", const std::string &valComment="")
Definition: ConfDataWriter.cpp:108
StringUtils.hpp
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::ConfDataWriter::valuePrecison
int valuePrecison
Definition: ConfDataWriter.hpp:283
gnsstk::ConfDataWriter::setVariableWidth
void setVariableWidth(const int width=0)
Definition: ConfDataWriter.hpp:268
gnsstk::ConfDataWriter::writeSection
void writeSection(const std::string &name, const std::string &comment="")
Definition: ConfDataWriter.cpp:264
gnsstk::ConfDataWriter::writeVariable
void writeVariable(const std::string &var, const int &val, const std::string &varComment="", const std::string &valComment="")
Definition: ConfDataWriter.hpp:175
gnsstk::ConfDataWriter::ConfDataWriter
ConfDataWriter()
Default constructor.
Definition: ConfDataWriter.hpp:104
gnsstk::ConfDataWriter::open
virtual void open(const std::string &fn)
Method to open a configuration data file to be written.
Definition: ConfDataWriter.hpp:135
FFTextStream.hpp
gnsstk::ConfDataWriter::setValuePrecision
void setValuePrecision(const int precision=6)
Definition: ConfDataWriter.hpp:273
gnsstk::ConfDataWriter::variableWidth
int variableWidth
Definition: ConfDataWriter.hpp:281
gnsstk::ConfDataWriter::writeSeparatorLine
void writeSeparatorLine(const std::string &s="-", const int &n=130)
Definition: ConfDataWriter.cpp:85
gnsstk::ConfDataWriter::writeEnd
void writeEnd()
Definition: ConfDataWriter.cpp:285
gnsstk::ConfDataWriter::writeCommentLine
void writeCommentLine(const std::string &comment)
Write a comment line start by '#'.
Definition: ConfDataWriter.cpp:76
gnsstk::ConfDataWriter::ConfDataWriter
ConfDataWriter(const std::string &file)
Definition: ConfDataWriter.hpp:124
std
Definition: Angle.hpp:142
gnsstk::ConfDataWriter
Definition: ConfDataWriter.hpp:99
gnsstk::ConfDataWriter::writeBlankLine
void writeBlankLine(const int &n=1)
Write several blank lines default write one line.
Definition: ConfDataWriter.cpp:92
example5.fn
string fn
Definition: example5.py:10
gnsstk::ConfDataWriter::writeVariableList
void writeVariableList(const std::string &var, const std::string valList[], const int &n, const std::string &varComment="", const std::string &valComment="")
Definition: ConfDataWriter.cpp:153
gnsstk::ConfDataWriter::ConfDataWriter
ConfDataWriter(const char *file)
Definition: ConfDataWriter.hpp:113
gnsstk::ConfDataWriter::writeHeader
virtual void writeHeader()
Definition: ConfDataWriter.cpp:62
gnsstk::FFTextStream
Definition: FFTextStream.hpp:63
gnsstk::ConfDataWriter::formattedPutLine
void formattedPutLine(const std::string &sline)
Write a string line to the file.
Definition: ConfDataWriter.cpp:296
gnsstk::ConfDataWriter::open
virtual void open(const char *fn)
Method to open a configuration data file to be written.
Definition: ConfDataWriter.cpp:52


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38