|
Isis 3 Programmer Reference
|
15 #include <QVarLengthArray>
17 #include "Constants.h"
117 void setUnits(QString value, QString units);
128 bool isNull(
const int index = 0)
const;
132 friend std::ostream &
operator<<(std::ostream &os,
136 operator double()
const {
140 operator int()
const {
141 return toInt(
operator[](0));
148 operator QString()
const;
152 QString
unit(
const int index = 0)
const;
163 QString
comment(
const int index)
const;
184 return !(*
this == key);
187 bool isEquivalent(QString string1,
int index = 0)
const;
223 const QString &string2);
226 static QString
readLine(std::istream &is,
bool insideComment);
229 std::vector< QString > &keywordComments,
230 QString &keywordName,
231 std::vector< std::pair<QString, QString> >
234 static QString readValue(QString &keyword,
bool "eProblem);
235 static QString readValue(QString &keyword,
bool "eProblem,
236 const std::vector< std::pair<char, char> > &
245 QString
reform(
const QString &value)
const;
246 QString
toPvl(
const QString &value)
const;
247 QString
toIPvl(
const QString &value)
const;
249 const QString &textToWrite,
QString name() const
Returns the keyword name.
friend std::istream & operator>>(std::istream &is, PvlKeyword &result)
Read in a keyword.
int m_indent
The number of indentations to make.
friend std::ostream & operator<<(std::ostream &os, const PvlKeyword &keyword)
Write out the keyword.
PvlKeyword & operator=(QString value)
Sets new values.
A single keyword-value pair.
PvlKeyword()
Constructs a blank PvlKeyword object.
void validateKeyword(PvlKeyword &pvlKwrd, QString psValueType="", PvlKeyword *pvlKwrdRange=NULL)
Validate Keyword for type and required values.
std::vector< QString > * m_units
The units for the values.
void init()
Clears all PvlKeyword data.
void addComments(const std::vector< QString > &comments)
This method adds multiple comments at once by calling AddComments on each element in the vector.
int indent() const
Returns the current indent level.
void addValue(QString value, QString unit="")
Adds a value with units.
void setFormat(PvlFormat *formatter)
Set the PvlFormatter used to format the keyword name and value(s)
void clear()
Clears all values and units for this PvlKeyword object.
static QString readLine(std::istream &is, bool insideComment)
This method reads one line of data from the input stream.
~PvlKeyword()
Destructs a PvlKeyword object.
void setUnits(QString units)
Sets the unit of measure for all current values if any exist.
QString toIPvl(const QString &value) const
Converts a value to iPVL format.
std::vector< QString > * m_comments
The comments for the keyword.
int width() const
Returns the current set longest keyword name.
PvlFormat * format()
Get the current PvlFormat or create one.
void addCommentWrapped(QString comment)
Automatically wraps and adds long comments to the PvlKeyword.
void setIndent(int indent)
Sets the indent level when outputted(for formatting)
int comments() const
Returns the number of lines of comments associated with this keyword.
void setName(QString name)
Sets the keyword name.
BigInt toBigInt(const QString &string)
Global function to convert from a string to a "big" integer.
void setWidth(int width)
The width of the longest keyword name (for formatting)
bool operator==(const PvlKeyword &key) const
Returns true of the keyword names match.
int toInt(const QString &string)
Global function to convert from a string to an integer.
QString toPvl(const QString &value) const
Converts a value to PVL format.
char * m_name
The keyword's name... This is a c-string for memory efficiency.
void addComment(QString comment)
Add a comment to the PvlKeyword.
long long int BigInt
Big int.
const QString & operator[](int index) const
Gets value for this object at specified index.
void writeSpaces(std::ostream &, int) const
This writes numSpaces spaces to the ostream.
bool operator!=(const PvlKeyword &key) const
Returns true of the keyword names do not match.
void setValue(QString value, QString unit="")
Sets new values.
bool isNamed(QString name) const
Determines whether two PvlKeywords have the same name or not.
PvlFormat * m_formatter
Formatter object.
PvlKeyword & operator+=(QString value)
Adds a value.
std::ostream & writeWithWrap(std::ostream &os, const QString &textToWrite, int startColumn, PvlFormat &format) const
Wraps output so that length doesn't exceed the character limit.
QVarLengthArray< QString, 1 > m_values
The values in the keyword.
double toDouble(const QString &string)
Global function to convert from a string to a double.
void clearComment()
Clears the current comments.
bool isNull(const int index=0) const
Decides whether a value is null or not at a given index.
int size() const
Returns the number of values stored in this keyword.
QString unit(const int index=0) const
Returns the units of measurement of the element of the array of values for the object at the specifie...
QString reform(const QString &value) const
Checks if the value needs to be converted to PVL or iPVL and returns it in the correct format.
bool isEquivalent(QString string1, int index=0) const
Checks to see if a value with a specified index is equivalent to another QString.
Parse and return elements of a Pvl sequence.
QString comment(const int index) const
Return a comment at the specified index.
int m_width
The width of the longest keyword.
static bool readCleanKeyword(QString keyword, std::vector< QString > &keywordComments, QString &keywordName, std::vector< std::pair< QString, QString > > &keywordValues)
This reads a keyword compressed back to 1 line of data (excluding comments, which are included on sep...
static bool stringEqual(const QString &string1, const QString &string2)
Checks to see if two QStrings are equal.
This is free and unencumbered software released into the public domain.