Isis 3 Developer Reference
PvlTokenizer.h
Go to the documentation of this file.
1 #ifndef PvlTokenizer_h
2 #define PvlTokenizer_h
3 
25 #include <iostream>
26 #include "PvlToken.h"
27 
28 #include <QString>
29 
30 namespace Isis {
92  class PvlTokenizer {
93 
94  protected:
95  std::vector<Isis::PvlToken> tokens;
99  QString ReadComment(std::istream &stream);
100  QString ReadToken(std::istream &stream);
101  bool SkipWhiteSpace(std::istream &stream);
102  QString ReadToSingleQuote(std::istream &stream);
103  QString ReadToDoubleQuote(std::istream &stream);
104  QString ReadToParen(std::istream &stream);
105  QString ReadToBrace(std::istream &stream);
106  void ParseCommaList(Isis::PvlToken &t, const QString &cl);
107  void ValidateCharacter(int c);
108 
109  public:
110  PvlTokenizer();
111  ~PvlTokenizer();
112 
113  void Load(std::istream &stream, const QString &terminator = "END");
114  void Clear();
115 
116  std::vector<Isis::PvlToken> & GetTokenList();
117  };
118 };
119 
120 #endif
QString ReadComment(std::istream &stream)
Reads and returns a comment from the stream.
Definition: PvlTokenizer.cpp:220
void Load(std::istream &stream, const QString &terminator="END")
Loads the Token list from a stream.
Definition: PvlTokenizer.cpp:63
~PvlTokenizer()
Destroys the Tokenizer object and token list.
Definition: PvlTokenizer.cpp:42
Container for Keyword-value pair.
Definition: PvlToken.h:54
QString ReadToken(std::istream &stream)
Reads and returns a token from the stream.
Definition: PvlTokenizer.cpp:248
std::vector< Isis::PvlToken > & GetTokenList()
Definition: PvlTokenizer.cpp:502
void ParseCommaList(Isis::PvlToken &t, const QString &cl)
This routine parses a QString containing a comma separated list.
Definition: PvlTokenizer.cpp:464
bool SkipWhiteSpace(std::istream &stream)
Skips over whitespace so long as it is not inside quotes.
Definition: PvlTokenizer.cpp:272
void Clear()
Empties the token list.
Definition: PvlTokenizer.cpp:47
void ValidateCharacter(int c)
Make sure a character is valid printable (non-control) character.
Definition: PvlTokenizer.cpp:511
PvlTokenizer()
Constructs a Tokenizer with an empty token list.
Definition: PvlTokenizer.cpp:37
QString ReadToBrace(std::istream &stream)
Definition: PvlTokenizer.cpp:412
QString ReadToDoubleQuote(std::istream &stream)
Definition: PvlTokenizer.cpp:292
std::vector< Isis::PvlToken > tokens
The array of Tokens parse out of the stream.
Definition: PvlTokenizer.h:95
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QString ReadToSingleQuote(std::istream &stream)
Definition: PvlTokenizer.cpp:330
Construct Token list from a stream.
Definition: PvlTokenizer.h:92
QString ReadToParen(std::istream &stream)
Definition: PvlTokenizer.cpp:368