62 istream::pos_type beforeKeywordPos = is.tellg();
66 if(is.eof() && !is.bad()) {
70 is.seekg(beforeKeywordPos, ios::beg);
72 QString msg =
"Expected PVL keyword named [Group], found keyword named [";
73 msg += readKeyword.name();
74 msg +=
"] when reading PVL";
78 if(readKeyword.size() == 1) {
82 if(is.eof() && !is.bad()) {
86 is.seekg(beforeKeywordPos, ios::beg);
88 QString msg =
"Expected a single value for group name, found [(";
90 for(
int i = 0; i < readKeyword.size(); i++) {
91 if(i != 0) msg +=
", ";
93 msg += readKeyword[i];
96 msg +=
")] when reading PVL";
101 for(
int comment = 0; comment < readKeyword.comments(); comment++) {
102 result.addComment(readKeyword.comment(comment));
106 beforeKeywordPos = is.tellg();
109 while(is.good() && readKeyword != termination) {
110 for(
unsigned int errorKey = 0;
111 errorKey <
sizeof(errorKeywords) /
sizeof(
PvlKeyword);
114 if(readKeyword == errorKeywords[errorKey]) {
115 if(is.eof() && !is.bad()) {
119 is.seekg(beforeKeywordPos, ios::beg);
121 QString msg =
"Unexpected [";
122 msg += readKeyword.name();
123 msg +=
"] in Group [";
124 msg += result.
name();
125 msg +=
"] when reading PVL";
132 beforeKeywordPos = is.tellg();
137 if(readKeyword != termination) {
138 if(is.eof() && !is.bad()) {
143 is.seekg(beforeKeywordPos, ios::beg);
145 QString msg =
"Group [" + result.
name();
146 msg +=
"] EndGroup not found before end of file when reading PVL";
161 bool removeFormatter =
false;
162 if(group.format() == NULL) {
164 removeFormatter =
true;
168 if(group.hasFormatTemplate()) temp = *(
Isis::PvlGroup *)group.formatTemplate();
171 if(temp.comments() > 0) {
172 for(
int k = 0; k < temp.comments(); k++) {
173 for(
int l = 0; l < group.indent(); l++) os <<
" ";
174 os << temp.comment(k) << group.format()->formatEOL();
180 os << group.nameKeyword() << group.format()->formatEOL();
181 group.setIndent(group.indent() + 2);
189 group.setIndent(group.indent() - 2);
190 for(
int i = 0; i < group.indent(); i++) os <<
" ";
191 os << group.format()->formatEnd(
"End_Group", group.nameKeyword());
193 if(removeFormatter) {
194 delete group.format();
195 group.setFormat(NULL);
224 QString sErrMsg =
"Group \"" + pPvlGrp.
name() +
"\" has no Keywords\n";
int keywords() const
Returns the number of keywords contained in the PvlContainer.
void clear()
Clears all values and units for this PvlKeyword object.
Contains more than one keyword-value pair.
void validateAllKeywords(PvlContainer &pPvlCont)
Validate All the Keywords in a Container comparing with the Template.
const PvlGroup & operator=(const PvlGroup &other)
This is an assignment operator.
Namespace for the standard library.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
void setName(const QString &name)
Set the name of the container.
void validateGroup(PvlGroup &pPvlGrp)
Validate a Group comparing with the Template Group.
const PvlContainer & operator=(const PvlContainer &other)
This is an assignment operator.
QString name() const
Returns the container name.
PvlGroup()
Creates a blank PvlGroup object.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
A type of error that could only have occurred due to a mistake on the user's part (e...
A single keyword-value pair.
A type of error that cannot be classified as any of the other error types.
Namespace for ISIS/Bullet specific routines.
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.