SinexBase.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_SINEXBASE_HPP
45 #define GNSSTK_SINEXBASE_HPP
46 
47 #include "CommonTime.hpp"
48 #include "Exception.hpp"
49 #include <stdint.h>
50 
51 namespace gnsstk
52 {
53  namespace Sinex
54  {
56 
57 
59 
60  const char HEAD_TAIL_START = '%';
61  const char BLOCK_START = '+';
62  const char BLOCK_END = '-';
63  const char COMMENT_START = '*';
64  const char DATA_START = ' ';
65  const char FIELD_DIV = ' ';
66  const size_t MIN_LINE_LEN = 1;
67  const size_t MAX_LINE_LEN = 80;
68  const float VERSION = 2.02f;
69  const std::string FILE_BEGIN("%=SNX");
70  const std::string FILE_END("%ENDSNX");
71  const std::string OBS_CODES("CDLMPR");
72  const std::string CONSTRAINT_CODES("012");
73  const std::string SOLUTION_TYPES("SOETCA ");
75 
80  extern bool isValidObsCode(char c, bool toss = true);
81 
86  extern bool isValidConstraintCode(char c, bool toss = true);
87 
92  extern bool isValidSolutionType(char c, bool toss = true);
93 
100  extern bool isValidLineStructure(const std::string& line,
101  size_t minLength,
102  size_t maxLength,
103  int divs[] = NULL,
104  bool toss = true);
105 
114  extern std::string formatStr(const std::string& value,
115  size_t width,
116  bool allowBlank = false);
117 
125  extern std::string formatInt(long value, size_t width);
126 
134  extern std::string formatUint(unsigned long value, size_t width);
135 
140  extern std::string formatFor(double value,
141  size_t width,
142  size_t expLen);
143 
144 
153  extern std::string formatFixed(double value,
154  size_t width,
155  size_t precision);
156 
157 
161  struct Time
162  {
164  Time() : year(0), doy(0), sod(0) {};
165  Time(const gnsstk::CommonTime& other) { *this = other; };
166  Time(const std::string& str) { *this = str; };
167 
169  virtual ~Time() {};
170 
172  operator gnsstk::CommonTime() const;
173  operator std::string() const;
174  void operator=(const gnsstk::CommonTime& other);
175  void operator=(const std::string& other);
176 
177  uint8_t year;
178  uint16_t doy;
179  uint32_t sod;
180  }; // struct Time
181 
183 
184  } // namespace Sinex
185 
186 } // namespace gnsstk
187 
188 #endif // GNSSTK_SINEXBASE_HPP
gnsstk::Sinex::BLOCK_END
const char BLOCK_END
Definition: SinexBase.hpp:62
gnsstk::Sinex::Time::Time
Time(const std::string &str)
Definition: SinexBase.hpp:166
gnsstk::Sinex::Time::doy
uint16_t doy
YY <= 50 implies 21st century, YY > 50 implies 20th.
Definition: SinexBase.hpp:178
gnsstk::Sinex::formatStr
std::string formatStr(const std::string &value, size_t width, bool allowBlank)
Definition: SinexBase.cpp:173
gnsstk::Sinex::Time::operator=
void operator=(const gnsstk::CommonTime &other)
Definition: SinexBase.cpp:287
gnsstk::Sinex::isValidObsCode
bool isValidObsCode(char c, bool toss)
Definition: SinexBase.cpp:57
gnsstk::Sinex::OBS_CODES
const std::string OBS_CODES("CDLMPR")
gnsstk::Sinex::formatFixed
std::string formatFixed(double value, size_t width, size_t precision)
Definition: SinexBase.cpp:233
NULL
#define NULL
Definition: getopt1.c:64
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Sinex::HEAD_TAIL_START
const char HEAD_TAIL_START
Definition: SinexBase.hpp:60
gnsstk::Sinex::Time::year
uint8_t year
Definition: SinexBase.hpp:177
gnsstk::Sinex::Time::Time
Time(const gnsstk::CommonTime &other)
Definition: SinexBase.hpp:165
gnsstk::Sinex::MIN_LINE_LEN
const size_t MIN_LINE_LEN
Definition: SinexBase.hpp:66
gnsstk::Sinex::FILE_END
const std::string FILE_END("%ENDSNX")
gnsstk::Sinex::FILE_BEGIN
const std::string FILE_BEGIN("%=SNX")
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::Sinex::VERSION
const float VERSION
Definition: SinexBase.hpp:68
gnsstk::Sinex::BLOCK_START
const char BLOCK_START
Definition: SinexBase.hpp:61
gnsstk::Sinex::isValidLineStructure
bool isValidLineStructure(const std::string &line, size_t minLen, size_t maxLen, int divs[], bool toss)
Definition: SinexBase.cpp:111
gnsstk::Sinex::isValidConstraintCode
bool isValidConstraintCode(char c, bool toss)
Definition: SinexBase.cpp:75
gnsstk::Sinex::formatFor
std::string formatFor(double value, size_t width, size_t expLen)
Definition: SinexBase.cpp:225
gnsstk::Sinex::MAX_LINE_LEN
const size_t MAX_LINE_LEN
Definition: SinexBase.hpp:67
gnsstk::Sinex::isValidSolutionType
bool isValidSolutionType(char c, bool toss)
Definition: SinexBase.cpp:93
gnsstk::Sinex::CONSTRAINT_CODES
const std::string CONSTRAINT_CODES("012")
gnsstk::Sinex::Time::sod
uint32_t sod
Day of year.
Definition: SinexBase.hpp:179
Exception.hpp
CommonTime.hpp
gnsstk::Sinex::COMMENT_START
const char COMMENT_START
Definition: SinexBase.hpp:63
gnsstk::Sinex::Time::Time
Time()
Constructors.
Definition: SinexBase.hpp:164
gnsstk::Sinex::formatInt
std::string formatInt(long value, size_t width)
Definition: SinexBase.cpp:189
gnsstk::Sinex::Time
Definition: SinexBase.hpp:161
gnsstk::Sinex::DATA_START
const char DATA_START
Definition: SinexBase.hpp:64
gnsstk::Sinex::SOLUTION_TYPES
const std::string SOLUTION_TYPES("SOETCA ")
gnsstk::Sinex::formatUint
std::string formatUint(unsigned long value, size_t width)
Definition: SinexBase.cpp:207
gnsstk::Sinex::Time::~Time
virtual ~Time()
Destructor.
Definition: SinexBase.hpp:169
gnsstk::Sinex::FIELD_DIV
const char FIELD_DIV
Definition: SinexBase.hpp:65


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