Isis 3 Programmer Reference
PvlTokenizer.h
1#ifndef PvlTokenizer_h
2#define PvlTokenizer_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include <iostream>
10#include "PvlToken.h"
11
12#include <QString>
13
14namespace Isis {
77
78 protected:
79 std::vector<Isis::PvlToken> tokens;
83 QString ReadComment(std::istream &stream);
84 QString ReadToken(std::istream &stream);
85 bool SkipWhiteSpace(std::istream &stream);
86 QString ReadToSingleQuote(std::istream &stream);
87 QString ReadToDoubleQuote(std::istream &stream);
88 QString ReadToParen(std::istream &stream);
89 QString ReadToBrace(std::istream &stream);
90 void ParseCommaList(Isis::PvlToken &t, const QString &cl);
91 void ValidateCharacter(int c);
92
93 public:
96
97 void Load(std::istream &stream, const QString &terminator = "END");
98 void Clear();
99
100 std::vector<Isis::PvlToken> & GetTokenList();
101 };
102};
103
104#endif
Container for Keyword-value pair.
Definition PvlToken.h:38
Construct Token list from a stream.
bool SkipWhiteSpace(std::istream &stream)
Skips over whitespace so long as it is not inside quotes.
void Clear()
Empties the token list.
~PvlTokenizer()
Destroys the Tokenizer object and token list.
QString ReadToken(std::istream &stream)
Reads and returns a token from the stream.
QString ReadComment(std::istream &stream)
Reads and returns a comment from the stream.
std::vector< Isis::PvlToken > tokens
The array of Tokens parse out of the stream.
void ValidateCharacter(int c)
Make sure a character is valid printable (non-control) character.
void ParseCommaList(Isis::PvlToken &t, const QString &cl)
This routine parses a QString containing a comma separated list.
PvlTokenizer()
Constructs a Tokenizer with an empty token list.
void Load(std::istream &stream, const QString &terminator="END")
Loads the Token list from a stream.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16