FFTextStream.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_FFTEXTSTREAM_HPP
45 #define GNSSTK_FFTEXTSTREAM_HPP
46 
47 #include "FFStream.hpp"
48 
49 namespace gnsstk
50 {
52 
53 
63  class FFTextStream : public FFStream
64  {
65  public:
67  FFTextStream();
68 
70  virtual ~FFTextStream();
71 
77  FFTextStream( const char* fn,
78  std::ios::openmode mode=std::ios::in );
79 
85  FFTextStream( const std::string& fn,
86  std::ios::openmode mode=std::ios::in );
87 
89  virtual void open( const char* fn,
90  std::ios::openmode mode );
91 
93  virtual void open( const std::string& fn,
94  std::ios::openmode mode );
95 
98  unsigned int lineNumber;
99 
100 
118  void formattedGetLine( std::string& line,
119  const bool expectEOF = false );
120 
121 
122  protected:
123 
128  virtual void tryFFStreamGet(FFData& rec);
129 
134  virtual void tryFFStreamPut(const FFData& rec);
135 
136  private:
138  void init();
139 
140  }; // End of class 'FFTextStream'
141 
143 
144 } // End of namespace gnsstk
145 
146 
147 inline std::ostream& endlpp(std::ostream& os)
148 {
149  gnsstk::FFTextStream *tos = dynamic_cast<gnsstk::FFTextStream*>(&os);
150  if (tos != nullptr)
151  {
152  tos->lineNumber++;
153  }
154  return flush(os.put(os.widen('\n')));
155 }
156 
157 #endif // GNSSTK_FFTEXTSTREAM_HPP
gnsstk::FFData
Definition: FFData.hpp:87
gnsstk::FFStream
Definition: FFStream.hpp:119
gnsstk::FFTextStream::formattedGetLine
void formattedGetLine(std::string &line, const bool expectEOF=false)
Definition: FFTextStream.cpp:149
gnsstk::FFTextStream::tryFFStreamPut
virtual void tryFFStreamPut(const FFData &rec)
Definition: FFTextStream.cpp:124
gnsstk::FFTextStream::lineNumber
unsigned int lineNumber
Definition: FFTextStream.hpp:98
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::FFTextStream::~FFTextStream
virtual ~FFTextStream()
Destructor.
Definition: FFTextStream.cpp:56
gnsstk::FFTextStream::init
void init()
Initialize internal data structures.
Definition: FFTextStream.cpp:97
gnsstk::FFTextStream::open
virtual void open(const char *fn, std::ios::openmode mode)
Overrides open to reset the line number.
Definition: FFTextStream.cpp:80
endlpp
std::ostream & endlpp(std::ostream &os)
Definition: FFTextStream.hpp:147
example5.fn
string fn
Definition: example5.py:10
FFStream.hpp
gnsstk::FFTextStream
Definition: FFTextStream.hpp:63
gnsstk::FFTextStream::tryFFStreamGet
virtual void tryFFStreamGet(FFData &rec)
Definition: FFTextStream.cpp:104
gnsstk::FFTextStream::FFTextStream
FFTextStream()
Default constructor.
Definition: FFTextStream.cpp:49


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