Isis 3 Programmer 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.
void Load(std::istream &stream, const QString &terminator="END")
Loads the Token list from a stream.
~PvlTokenizer()
Destroys the Tokenizer object and token list.
Container for Keyword-value pair.
Definition: PvlToken.h:54
QString ReadToken(std::istream &stream)
Reads and returns a token from the stream.
void ParseCommaList(Isis::PvlToken &t, const QString &cl)
This routine parses a QString containing a comma separated list.
bool SkipWhiteSpace(std::istream &stream)
Skips over whitespace so long as it is not inside quotes.
void Clear()
Empties the token list.
void ValidateCharacter(int c)
Make sure a character is valid printable (non-control) character.
PvlTokenizer()
Constructs a Tokenizer with an empty token list.
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
Construct Token list from a stream.
Definition: PvlTokenizer.h:92