|
Isis Developer Reference
|
Go to the documentation of this file.
15 #include <QVarLengthArray>
117 void setUnits(QString value, QString units);
126 return m_values.size();
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;
161 return (m_comments ? m_comments->size() : 0);
163 QString
comment(
const int index)
const;
172 if(!m_name && !key.m_name)
return true;
173 if(!m_name || !key.m_name)
return false;
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,
268 QVarLengthArray<QString, 1> m_values;
271 std::vector<QString> *m_units;
274 std::vector<QString> *m_comments;
278 void writeSpaces(std::ostream &,
int)
const;
QString name() const
Returns the keyword name.
Definition: PvlKeyword.h:98
friend std::istream & operator>>(std::istream &is, PvlKeyword &result)
Read in a keyword.
Definition: PvlKeyword.cpp:909
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
friend std::ostream & operator<<(std::ostream &os, const PvlKeyword &keyword)
Write out the keyword.
Definition: PvlKeyword.cpp:1765
PvlKeyword & operator=(QString value)
Sets new values.
Definition: PvlKeyword.cpp:231
A single keyword-value pair.
Definition: PvlKeyword.h:82
PvlKeyword()
Constructs a blank PvlKeyword object.
Definition: PvlKeyword.cpp:22
void validateKeyword(PvlKeyword &pvlKwrd, QString psValueType="", PvlKeyword *pvlKwrdRange=NULL)
Validate Keyword for type and required values.
Definition: PvlKeyword.cpp:1873
void addComments(const std::vector< QString > &comments)
This method adds multiple comments at once by calling AddComments on each element in the vector.
Definition: PvlKeyword.cpp:1102
int indent() const
Returns the current indent level.
Definition: PvlKeyword.h:213
void addValue(QString value, QString unit="")
Adds a value with units.
Definition: PvlKeyword.cpp:252
void setFormat(PvlFormat *formatter)
Set the PvlFormatter used to format the keyword name and value(s)
Definition: PvlKeyword.cpp:885
void clear()
Clears all values and units for this PvlKeyword object.
Definition: PvlKeyword.cpp:291
static QString readLine(std::istream &is, bool insideComment)
This method reads one line of data from the input stream.
Definition: PvlKeyword.cpp:1703
~PvlKeyword()
Destructs a PvlKeyword object.
Definition: PvlKeyword.cpp:64
void setUnits(QString units)
Sets the unit of measure for all current values if any exist.
Definition: PvlKeyword.cpp:166
IString ConvertWhiteSpace()
Returns the string with all "new lines", "carriage returns", "tabs", "form feeds",...
Definition: IString.cpp:1238
std::istream & operator>>(std::istream &is, PvlKeyword &result)
Read in a keyword.
Definition: PvlKeyword.cpp:909
QString toIPvl(const QString &value) const
Converts a value to iPVL format.
Definition: PvlKeyword.cpp:482
int width() const
Returns the current set longest keyword name.
Definition: PvlKeyword.h:208
static QString readValue(QString &keyword, bool "eProblem)
Definition: PvlKeyword.cpp:1546
PvlFormat * format()
Get the current PvlFormat or create one.
Definition: PvlKeyword.cpp:896
void addCommentWrapped(QString comment)
Automatically wraps and adds long comments to the PvlKeyword.
Definition: PvlKeyword.cpp:410
void setIndent(int indent)
Sets the indent level when outputted(for formatting)
Definition: PvlKeyword.h:203
@ Traverse
Search child objects.
Definition: PvlObject.h:158
int comments() const
Returns the number of lines of comments associated with this keyword.
Definition: PvlKeyword.h:160
IString UpCase()
Converst any lower case characters in the object IString with uppercase characters.
Definition: IString.cpp:617
void setName(QString name)
Sets the keyword name.
Definition: PvlKeyword.cpp:120
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
BigInt toBigInt(const QString &string)
Global function to convert from a string to a "big" integer.
Definition: IString.cpp:115
int Size() const
Number of arrays in the sequence.
Definition: PvlSequence.h:70
void setWidth(int width)
The width of the longest keyword name (for formatting)
Definition: PvlKeyword.h:194
bool operator==(const PvlKeyword &key) const
Returns true of the keyword names match.
Definition: PvlKeyword.h:171
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
QString toPvl(const QString &value) const
Converts a value to PVL format.
Definition: PvlKeyword.cpp:510
void addComment(QString comment)
Add a comment to the PvlKeyword.
Definition: PvlKeyword.cpp:376
long long int BigInt
Big int.
Definition: Constants.h:49
const QString & operator[](int index) const
Gets value for this object at specified index.
Definition: PvlKeyword.cpp:340
Isis exception class.
Definition: IException.h:91
#define ASSERT(x)
Definition: IsisDebug.h:134
bool operator!=(const PvlKeyword &key) const
Returns true of the keyword names do not match.
Definition: PvlKeyword.h:183
void setValue(QString value, QString unit="")
Sets new values.
Definition: PvlKeyword.cpp:155
bool isNamed(QString name) const
Determines whether two PvlKeywords have the same name or not.
Definition: PvlKeyword.h:110
PvlFormat * m_formatter
Formatter object.
Definition: PvlKeyword.h:254
PvlKeyword & operator+=(QString value)
Adds a value.
Definition: PvlKeyword.cpp:285
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.
Definition: PvlKeyword.cpp:611
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
Namespace for the standard library.
void clearComment()
Clears the current comments.
Definition: PvlKeyword.cpp:428
IString Token(const IString &separator)
Returns the first token in the IString.
Definition: IString.cpp:897
bool isNull(const int index=0) const
Decides whether a value is null or not at a given index.
Definition: PvlKeyword.cpp:102
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
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...
Definition: PvlKeyword.cpp:357
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.
Definition: PvlKeyword.cpp:458
ostream & operator<<(std::ostream &os, const Isis::PvlKeyword &keyword)
Write out the keyword.
Definition: PvlKeyword.cpp:1765
Adds specific functionality to C++ strings.
Definition: IString.h:165
bool isEquivalent(QString string1, int index=0) const
Checks to see if a value with a specified index is equivalent to another QString.
Definition: PvlKeyword.cpp:562
static Preference & Preferences(bool unitTest=false)
Definition: Preference.cpp:86
Parse and return elements of a Pvl sequence.
Definition: PvlSequence.h:46
QString comment(const int index) const
Return a comment at the specified index.
Definition: PvlKeyword.cpp:441
QString ArraySubscriptNotInRange(int index)
This error should be used when an Isis object or application is checking array bounds and the legal r...
Definition: ArraySubscriptNotInRange.cpp:31
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...
Definition: PvlKeyword.cpp:1123
static bool stringEqual(const QString &string1, const QString &string2)
Checks to see if two QStrings are equal.
Definition: PvlKeyword.cpp:535
IString Remove(const std::string &del)
Remove all instances of any character in the string from the IString.
Definition: IString.cpp:1266
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16