Isis Developer Reference
PvlTokenizer.h
Go to the documentation of this file.
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.
Definition PvlTokenizer.h:76
bool SkipWhiteSpace(std::istream &stream)
Skips over whitespace so long as it is not inside quotes.
Definition PvlTokenizer.cpp:257
void Clear()
Empties the token list.
Definition PvlTokenizer.cpp:32
QString ReadToSingleQuote(std::istream &stream)
Definition PvlTokenizer.cpp:315
~PvlTokenizer()
Destroys the Tokenizer object and token list.
Definition PvlTokenizer.cpp:27
QString ReadToBrace(std::istream &stream)
Definition PvlTokenizer.cpp:397
QString ReadToParen(std::istream &stream)
Definition PvlTokenizer.cpp:353
QString ReadToDoubleQuote(std::istream &stream)
Definition PvlTokenizer.cpp:277
std::vector< Isis::PvlToken > & GetTokenList()
Definition PvlTokenizer.cpp:487
QString ReadToken(std::istream &stream)
Reads and returns a token from the stream.
Definition PvlTokenizer.cpp:233
QString ReadComment(std::istream &stream)
Reads and returns a comment from the stream.
Definition PvlTokenizer.cpp:205
std::vector< Isis::PvlToken > tokens
The array of Tokens parse out of the stream.
Definition PvlTokenizer.h:79
void ValidateCharacter(int c)
Make sure a character is valid printable (non-control) character.
Definition PvlTokenizer.cpp:496
void ParseCommaList(Isis::PvlToken &t, const QString &cl)
This routine parses a QString containing a comma separated list.
Definition PvlTokenizer.cpp:449
PvlTokenizer()
Constructs a Tokenizer with an empty token list.
Definition PvlTokenizer.cpp:22
void Load(std::istream &stream, const QString &terminator="END")
Loads the Token list from a stream.
Definition PvlTokenizer.cpp:48
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16