OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNmeaMessageSequencer.cpp
Go to the documentation of this file.
2 #include <fstream>
3 #include <sstream>
4 
6 :m_inputStream(0)
7 {
8 
9 }
10 
12 :m_inputStream(0)
13 {
14  initialize(file);
15 }
16 
18 :m_inputStream(0)
19 {
20  initialize(str);
21 }
22 
23 
25 {
26  destroy();
27 }
28 
30 {
31  destroy();
32  m_inputStream = new std::ifstream(file.c_str());
33 }
34 
35 void ossimNmeaMessageSequencer::initialize(const std::string& str)
36 {
37  destroy();
39 }
40 
42 {
43  if(m_inputStream)
44  {
45  delete m_inputStream;
46  m_inputStream = 0;
47  }
48 }
49 
51 {
52  bool result = false;
53 
54  try {
56  result = true;
57  }
58  catch (...)
59  {
60  result = false;
61  }
62 
63  return result;
64 }
65 
67 {
68  bool result = false;
69 
70  if(m_inputStream)
71  {
72  result = m_inputStream->good();
73  }
74 
75  return result;
76 }
77 
79 {
80  if(m_inputStream)
81  {
82  m_inputStream->clear();
83  m_inputStream->seekg(0);
84  }
85 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
virtual void parseMessage(std::istream &in)
Parses a standard formatted NMEA message.
void initialize(const ossimFilename &file)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
virtual bool next(ossimNmeaMessage &msg)