Isis Developer Reference
Pvl.h
Go to the documentation of this file.
1 #ifndef Pvl_h
2 #define Pvl_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 #include <fstream>
11 #include "PvlObject.h"
12 
13 namespace Isis {
119  class Pvl : public Isis::PvlObject {
120  public:
121  Pvl();
122  Pvl(const QString &file);
123  Pvl(const Pvl &other);
124 
125  friend std::istream &operator>>(std::istream &is, Pvl &pvl);
126  friend std::ostream &operator<<(std::ostream &os, Isis::Pvl &pvl);
127  void fromString(const std::string &str);
128 
129  ~Pvl() {
130  if(m_internalTemplate) delete m_formatTemplate;
131  };
132 
133  void read(const QString &file);
134 
135  void write(const QString &file);
136  void append(const QString &file);
137 
144  void setTerminator(const QString &term) {
145  m_terminator = term;
146  };
153  QString terminator() const {
154  return m_terminator;
155  };
156 
157  void setFormatTemplate(Isis::Pvl &temp);
158  void setFormatTemplate(const QString &filename);
159 
160  const Pvl &operator=(const Pvl &other);
161 
163  void validatePvl(const Pvl & pPvl, Pvl & pPvlResults);
164 
165  private:
166  void init();
167  bool m_internalTemplate;
168  QString m_terminator;
170  };
171 };
172 #endif
Isis::Pvl::operator<<
friend std::ostream & operator<<(std::ostream &os, Isis::Pvl &pvl)
This stream will not handle the end of line sequence.
Definition: Pvl.cpp:249
Isis::PvlContainer::m_formatTemplate
PvlContainer * m_formatTemplate
Definition: PvlContainer.h:305
Isis::PvlKeyword::name
QString name() const
Returns the keyword name.
Definition: PvlKeyword.h:98
FileName.h
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::PvlObject::group
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
Isis::operator<<
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:314
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::Pvl::setFormatTemplate
void setFormatTemplate(Isis::Pvl &temp)
Definition: Pvl.cpp:227
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::Pvl::append
void append(const QString &file)
Appends PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:184
Isis::PvlContainer::m_filename
QString m_filename
This contains the filename used to initialize the pvl object.
Definition: PvlContainer.h:283
Isis::Pvl::fromString
void fromString(const std::string &str)
Load PVL information from a string.
Definition: Pvl.cpp:60
Isis::PvlFormat
Formats a Pvl name value pair to Isis standards.
Definition: PvlFormat.h:108
Isis::Pvl::operator>>
friend std::istream & operator>>(std::istream &is, Pvl &pvl)
Reads keywords from the instream and appends them to the Pvl object.
Definition: Pvl.cpp:403
Isis::PvlContainer::comment
QString comment(const int index) const
Definition: PvlContainer.h:265
Isis::PvlContainer::addKeyword
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Definition: PvlContainer.cpp:202
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
PvlGroup.h
Isis::PvlObject::groups
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::Message::FileOpen
QString FileOpen(const QString &filename)
This error should be used when a file could not be opened.
Definition: FileOpen.cpp:11
Isis::PvlObject::hasGroup
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
PvlTokenizer.h
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::PvlObject::objects
int objects() const
Returns the number of objects.
Definition: PvlObject.h:219
Isis::PvlObject::addObject
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Isis::Pvl::write
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:130
Isis::Pvl::validatePvl
void validatePvl(const Pvl &pPvl, Pvl &pPvlResults)
Validate a Pvl with the Template Pvl.
Definition: Pvl.cpp:529
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
PvlFormat.h
Isis::PvlContainer::validateAllKeywords
void validateAllKeywords(PvlContainer &pPvlCont)
Validate All the Keywords in a Container comparing with the Template.
Definition: PvlContainer.cpp:394
Isis::PvlContainer::setFormat
void setFormat(PvlFormat *format)
Definition: PvlContainer.h:251
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Pvl::read
void read(const QString &file)
Loads PVL information from a stream.
Definition: Pvl.cpp:90
Isis::Pvl::operator=
const Pvl & operator=(const Pvl &other)
This is an assignment operator.
Definition: Pvl.cpp:510
Isis::Pvl::terminator
QString terminator() const
Returns the terminator used to signify the end of the PVL informationDefaults to "END".
Definition: Pvl.h:153
Isis::PvlObject::hasKeyword
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
Isis::PvlObject::operator=
const PvlObject & operator=(const PvlObject &other)
This is an assignment operator.
Definition: PvlObject.cpp:821
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::PvlContainer::hasFormatTemplate
bool hasFormatTemplate()
Definition: PvlContainer.h:240
Isis::PvlContainer::indent
int indent()
Definition: PvlContainer.h:255
Isis::PvlGroup::validateGroup
void validateGroup(PvlGroup &pPvlGrp)
Validate a Group comparing with the Template Group.
Definition: PvlGroup.cpp:207
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::PvlFormat::formatEOL
virtual QString formatEOL()
Definition: PvlFormat.h:147
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::PvlObject::validateObject
void validateObject(PvlObject &pPvlObj)
Validate Object.
Definition: PvlObject.cpp:841
Isis::PvlObject::hasObject
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition: PvlObject.h:323
Isis::Pvl::~Pvl
~Pvl()
Definition: Pvl.h:129
Isis::PvlContainer::format
PvlFormat * format()
Definition: PvlContainer.h:248
Isis::Pvl::Pvl
Pvl()
Constructs an empty Pvl object.
Definition: Pvl.cpp:24
Isis::PvlContainer::comments
int comments() const
Definition: PvlContainer.h:262
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Isis::Message::FileCreate
QString FileCreate(const QString &filename)
This error should be used when a file could not be created.
Definition: FileCreate.cpp:12
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::PvlContainer::formatTemplate
PvlContainer * formatTemplate()
Definition: PvlContainer.h:244
Isis::PvlObject::deleteObject
void deleteObject(const QString &name)
Remove an object from the current PvlObject.
Definition: PvlObject.cpp:366
PvlKeyword.h
PvlObject.h
Isis::PvlContainer::keywords
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:86
Isis::PvlObject::findKeyword
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Definition: PvlObject.cpp:177
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
Isis::PvlContainer::setIndent
void setIndent(int indent)
Definition: PvlContainer.h:258
Isis::PvlContainer
Contains more than one keyword-value pair.
Definition: PvlContainer.h:49
Isis::PvlObject::deleteGroup
void deleteGroup(const QString &name)
Remove a group from the current PvlObject.
Definition: PvlObject.cpp:408
Isis::operator>>
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:447
Isis::PvlContainer::setFormatTemplate
void setFormatTemplate(PvlContainer &ref)
Definition: PvlContainer.h:236
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Pvl::setTerminator
void setTerminator(const QString &term)
Sets the terminator used to signify the end of the PVL informationDefaults to "END".
Definition: Pvl.h:144
Message.h
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126