Isis 3 Programmer Reference
|
A single keyword-value pair. More...
#include <PvlKeyword.h>
Public Member Functions | |
PvlKeyword () | |
Constructs a blank PvlKeyword object. | |
PvlKeyword (QString name) | |
Constructs a PvlKeyword object with a name. | |
PvlKeyword (QString name, QString value, QString unit="") | |
Constructs a PvlKeyword object with a name, value and units. | |
PvlKeyword (const PvlKeyword &other) | |
Copy constructor. | |
~PvlKeyword () | |
Destructs a PvlKeyword object. | |
void | setName (QString name) |
Sets the keyword name. | |
QString | name () const |
Returns the keyword name. | |
bool | isNamed (QString name) const |
Determines whether two PvlKeywords have the same name or not. | |
void | setValue (QString value, QString unit="") |
Sets new values. | |
void | setJsonValue (nlohmann::json jsonobj, QString unit="") |
Sets new value from Json. | |
void | setUnits (QString units) |
Sets the unit of measure for all current values if any exist. | |
void | setUnits (QString value, QString units) |
Sets the unit of measure for a given value. | |
PvlKeyword & | operator= (QString value) |
Sets new values. | |
void | addValue (QString value, QString unit="") |
Adds a value with units. | |
void | addJsonValue (nlohmann::json jsonobj, QString unit="") |
Adds a value with units. | |
PvlKeyword & | operator+= (QString value) |
Adds a value. | |
int | size () const |
Returns the number of values stored in this keyword. | |
bool | isNull (const int index=0) const |
Decides whether a value is null or not at a given index. | |
void | clear () |
Clears all values and units for this PvlKeyword object. | |
operator double () const | |
Returns the first value in this keyword converted to a double. | |
operator int () const | |
Returns the first value in this keyword converted to an integer. | |
operator Isis::BigInt () const | |
Returns the first value in this keyword converted to a BigInt. | |
operator QString () const | |
const QString & | operator[] (int index) const |
Gets value for this object at specified index. | |
QString & | operator[] (int index) |
Gets value for this object at specified index. | |
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 specified index. | |
void | addComment (QString comment) |
Add a comment to the PvlKeyword. | |
void | addCommentWrapped (QString comment) |
Automatically wraps and adds long comments to the PvlKeyword. | |
void | addComments (const std::vector< QString > &comments) |
This method adds multiple comments at once by calling AddComments on each element in the vector. | |
int | comments () const |
Returns the number of lines of comments associated with this keyword. | |
QString | comment (const int index) const |
Return a comment at the specified index. | |
void | clearComment () |
Clears the current comments. | |
bool | operator== (const PvlKeyword &key) const |
Returns true of the keyword names match. | |
bool | operator!= (const PvlKeyword &key) const |
Returns true of the keyword names do not match. | |
bool | isEquivalent (QString string1, int index=0) const |
Checks to see if a value with a specified index is equivalent to another QString. | |
void | setWidth (int width) |
The width of the longest keyword name (for formatting) | |
void | setIndent (int indent) |
Sets the indent level when outputted(for formatting) | |
int | width () const |
Returns the current set longest keyword name. | |
int | indent () const |
Returns the current indent level. | |
PvlKeyword & | operator= (Isis::PvlSequence &seq) |
Add values and units from a PvlSequence. | |
void | setFormat (PvlFormat *formatter) |
Set the PvlFormatter used to format the keyword name and value(s) | |
PvlFormat * | format () |
Get the current PvlFormat or create one. | |
const PvlKeyword & | operator= (const PvlKeyword &other) |
This is an assignment operator. | |
void | validateKeyword (PvlKeyword &pvlKwrd, QString psValueType="", PvlKeyword *pvlKwrdRange=NULL) |
Validate Keyword for type and required values. | |
Static Public Member Functions | |
static bool | stringEqual (const QString &string1, const QString &string2) |
Checks to see if two QStrings are equal. | |
static QString | readLine (std::istream &is, bool insideComment) |
This method reads one line of data from the input stream. | |
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 separate lines of data before the keyword). | |
static QString | readValue (QString &keyword, bool "eProblem) |
static QString | readValue (QString &keyword, bool "eProblem, const std::vector< std::pair< char, char > > &otherDelimiters) |
This method looks for a data element in the QString. | |
Protected Member Functions | |
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. | |
QString | toPvl (const QString &value) const |
Converts a value to PVL format. | |
QString | toIPvl (const QString &value) const |
Converts a value to iPVL format. | |
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. | |
Protected Attributes | |
PvlFormat * | m_formatter |
Formatter object. | |
Private Member Functions | |
void | init () |
Clears all PvlKeyword data. | |
void | writeSpaces (std::ostream &, int) const |
This writes numSpaces spaces to the ostream. | |
Private Attributes | |
char * | m_name |
The keyword's name... This is a c-string for memory efficiency. | |
QVarLengthArray< QString, 1 > | m_values |
The values in the keyword. | |
std::vector< QString > * | m_units |
The units for the values. | |
std::vector< QString > * | m_comments |
The comments for the keyword. | |
int | m_width |
The width of the longest keyword. | |
int | m_indent |
The number of indentations to make. | |
Friends | |
std::istream & | operator>> (std::istream &is, PvlKeyword &result) |
Read in a keyword. | |
std::ostream & | operator<< (std::ostream &os, const PvlKeyword &keyword) |
Write out the keyword. | |
A single keyword-value pair.
This class is used to create a single PVL keyword-value pair. PvlContainer can combine PvlKeyword objects and organize them so they look clean on output.
2005-04-08 Leah Dahmer - Wrote class documentation.
2005-04-08 Leah Dahmer - Added the writeWithWrap() method so keyword values will now be wrapped when the length exceeds 80 characters.
2005-05-18 Jeff Anderson - Fixed minor problems with wrapping code.
2006-04-05 Elizabeth Miller - Added AddCommentWrapped() method.
2006-09-05 Stuart Sides - Added ability to format keywords in different ways using the PvlFormat class.
2007-08-20 Brendan George - Added checking to ensure Keyword Name contains no whitespace.
2008-02-08 Christopher Austin - Altered WriteWithWrap to not bomb when 2 or more single statement lines in a row are over 78 characters long.
2008-07-03 Steven Lambright - Added const functionality.
2008-07-10 Steven Lambright - stringEqual is now static, all AddComments methods are public.
2008-09-30 Christopher Austin - replaced all std::endl in the << operator as well as writeWithWrap() with PvlFormat.FormatEOL(), and formatted wraps accordingly.
2009-08-18 Eric Hyer - Added both SetUnits methods and ASSERT macro.
2009-09-09 Steven Lambright - Removed ASSERT macro, fixed formatting of error in SetUnits, and fixed text wrapping when a single array element needed split up into multiple lines.
2009-12-07 Steven Lambright - Added stream input operator for reading.
2010-01-19 Travis Addair - Added SetCharLimit method allowing users to set the point at which a keyword value is output to the next line down.
2010-02-04 Travis Addair - Moved the SetCharLimit method to PvlFormat class.
2010-04-13 Eric Hyer - Added copy constructor. Added assignment operator.
2010-06-25 Steven Lambright - NULLs ('\0') now count as binary.
2010-09-27 Sharmila Prasad - API to Validate a Keyword for type and values.
2010-10-18 Sharmila Prasad - Added more options for the keyword validation.
2011-04-12 Steven Lambright - Lessened the memory footprint by changing m_comments and m_units to pointers, m_values to a QVarLengthArray and m_name to a char *.
2011-07-07 Sharmila Prasad - While validating keyword, display appropriate error msg when converting string to integer which has a double value.
2013-03-11 Steven Lambright and Mathew Eis - Brought method names and member variable names up to the current Isis 3 coding standards. Fixes #1533.
2013-06-05 Tracie Sucharski - When splitting keywords make sure the continuation lines does not start with "//" since Isis Pvl considers that a comment. Fixes #1230.
2014-05-13 Jeannie Backer - Changed operator[] error message to construct a QString from the m_name char* instead of using the toString() method. The call to this method was using toString(bool) and always printing the QString "Yes" instead of the keyword name. Added padding on control statements to bring the code closer to ISIS Coding Standards. References #1659.
Definition at line 87 of file PvlKeyword.h.
Isis::PvlKeyword::PvlKeyword | ( | ) |
Constructs a blank PvlKeyword object.
Definition at line 22 of file PvlKeyword.cpp.
References init().
Isis::PvlKeyword::PvlKeyword | ( | QString | name | ) |
Constructs a PvlKeyword object with a name.
name | The keyword name |
Definition at line 32 of file PvlKeyword.cpp.
Isis::PvlKeyword::PvlKeyword | ( | QString | name, |
QString | value, | ||
QString | unit = "" ) |
Constructs a PvlKeyword object with a name, value and units.
Defaults to unit="".
name | The keyword name. |
value | The keyword values. |
unit | The units the values are given in. |
Definition at line 46 of file PvlKeyword.cpp.
References addValue(), init(), name(), setName(), and unit().
Isis::PvlKeyword::PvlKeyword | ( | const PvlKeyword & | other | ) |
Isis::PvlKeyword::~PvlKeyword | ( | ) |
Destructs a PvlKeyword object.
Definition at line 64 of file PvlKeyword.cpp.
References m_comments, m_name, and m_units.
void Isis::PvlKeyword::addComment | ( | QString | comment | ) |
Add a comment to the PvlKeyword.
comment | The new comment. |
Definition at line 433 of file PvlKeyword.cpp.
References comment(), and m_comments.
Referenced by addComments(), addCommentWrapped(), Isis::ProcessImportFits::extractFitsLabels(), Isis::fitsToJson(), and Isis::ControlNetVersioner::toPvl().
void Isis::PvlKeyword::addComments | ( | const std::vector< QString > & | comments | ) |
This method adds multiple comments at once by calling AddComments on each element in the vector.
comments | Comments to associate with this keyword |
Definition at line 1159 of file PvlKeyword.cpp.
References addComment(), and comments().
void Isis::PvlKeyword::addCommentWrapped | ( | QString | comment | ) |
Automatically wraps and adds long comments to the PvlKeyword.
comment | The new comment to add |
Definition at line 467 of file PvlKeyword.cpp.
References addComment(), comment(), and Isis::IString::Token().
void Isis::PvlKeyword::addJsonValue | ( | nlohmann::json | jsonobj, |
QString | unit = "" ) |
Adds a value with units.
If no current value exists, this method sets the given json value. Otherwise, it retains any current values and adds the json value given to the array of values for this PvlKeyword object using addValue. Defaults to unit = "" (empty QString).
jsonobj | New jsonobj to be parsed and assigned. |
unit | Units of measurement corresponding to the value. |
Isis::iException::Unknown | - jsonobj cannot be an array of values |
Definition at line 302 of file PvlKeyword.cpp.
References addValue(), name(), unit(), and Isis::IException::Unknown.
Referenced by Isis::PvlObject::PvlObject(), and setJsonValue().
void Isis::PvlKeyword::addValue | ( | QString | value, |
QString | unit = "" ) |
Adds a value with units.
If no current value exists, this method sets the given value. Otherwise, it retains any current values and adds the value given to the array of values for this PvlKeyword object. Defaults to unit = "" (empty QString).
value | New value to be assigned. |
unit | Units of measurement corresponding to the value. |
Definition at line 268 of file PvlKeyword.cpp.
References m_units, m_values, and unit().
Referenced by Isis::DbProfile::add(), addJsonValue(), Isis::ControlNetDiff::addUniqueMeasure(), Isis::ControlNetDiff::addUniquePoint(), Isis::PvlToPvlTranslationManager::DoTranslation(), Isis::UserInterface::evaluateOption(), Isis::ControlNetDiff::makeKeyword(), Isis::ControlNetDiff::makeKeyword(), operator+=(), operator=(), PvlKeyword(), and setValue().
void Isis::PvlKeyword::clear | ( | ) |
Clears all values and units for this PvlKeyword object.
Definition at line 348 of file PvlKeyword.cpp.
References m_units, and m_values.
Referenced by Isis::Cube::applyVirtualBandsToLabel(), init(), operator=(), operator=(), setJsonValue(), setValue(), and Isis::ProcessExportPds4::StandardAllMapping().
void Isis::PvlKeyword::clearComment | ( | ) |
QString Isis::PvlKeyword::comment | ( | const int | index | ) | const |
Return a comment at the specified index.
index | The index of the comment. |
iException | ArraySubscriptNotInRange (index) Index out of bounds. |
Definition at line 498 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_comments, and Isis::IException::Programmer.
Referenced by addComment(), addCommentWrapped(), Isis::pvlKeywordToJSON(), and readCleanKeyword().
|
inline |
Returns the number of lines of comments associated with this keyword.
Definition at line 168 of file PvlKeyword.h.
References m_comments.
Referenced by addComments(), Isis::pvlKeywordToJSON(), and readCleanKeyword().
PvlFormat * Isis::PvlKeyword::format | ( | ) |
Get the current PvlFormat or create one.
Definition at line 953 of file PvlKeyword.cpp.
References m_formatter.
Referenced by writeWithWrap().
|
inline |
Returns the current indent level.
Definition at line 221 of file PvlKeyword.h.
References m_indent.
Referenced by setIndent().
|
private |
Clears all PvlKeyword data.
Definition at line 83 of file PvlKeyword.cpp.
References clear(), m_comments, m_formatter, m_indent, m_name, m_units, and m_width.
Referenced by PvlKeyword(), PvlKeyword(), PvlKeyword(), and PvlKeyword().
bool Isis::PvlKeyword::isEquivalent | ( | QString | QString1, |
int | index = 0 ) const |
Checks to see if a value with a specified index is equivalent to another QString.
QString1 | The QString to compare the value to. |
index | The index of the existing value. |
iException | ArraySubscriptNotInRange (index) Index out of bounds. |
Definition at line 619 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_values, Isis::IException::Programmer, and stringEqual().
|
inline |
Determines whether two PvlKeywords have the same name or not.
name | The name of the keyword to compare with this one. |
Definition at line 115 of file PvlKeyword.h.
References name(), and stringEqual().
Referenced by Isis::MosaicController::convertV1ToV2(), Isis::ImageFileListWidget::find(), Isis::KernelDb::findAll(), Isis::KernelDb::loadKernelDbFiles(), and Isis::KernelDb::matches().
bool Isis::PvlKeyword::isNull | ( | const int | index = 0 | ) | const |
Decides whether a value is null or not at a given index.
Defaults to index = 0.
index | The value index |
Definition at line 102 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_values, Isis::IException::Programmer, size(), and stringEqual().
|
inline |
Returns the keyword name.
Definition at line 103 of file PvlKeyword.h.
References m_name.
Referenced by Isis::PvlFlatMap::add(), addJsonValue(), Isis::PvlContainer::addKeyword(), Isis::PvlTranslationTable::AddTable(), Isis::PvlFlatMap::append(), Isis::Strategy::composite(), Isis::ProcessImportFits::extractFitsLabels(), Isis::fitsToJson(), isNamed(), Isis::ProcessMosaic::MatchBandBinGroup(), Isis::PvlContainer::operator-=(), PvlKeyword(), PvlKeyword(), setName(), Isis::PvlContainer::type(), Isis::PvlContainer::validateAllKeywords(), validateKeyword(), and Isis::PvlContainer::validateRepeatOption().
|
inline |
Returns the first value in this keyword converted to a double.
Definition at line 144 of file PvlKeyword.h.
References Isis::toDouble().
|
inline |
Returns the first value in this keyword converted to an integer.
Definition at line 148 of file PvlKeyword.h.
References Isis::toInt().
|
inline |
Returns the first value in this keyword converted to a BigInt.
Definition at line 152 of file PvlKeyword.h.
References Isis::toBigInt().
Isis::PvlKeyword::operator QString | ( | ) | const |
Definition at line 358 of file PvlKeyword.cpp.
|
inline |
Returns true of the keyword names do not match.
key | The keyword to compare names with |
Definition at line 191 of file PvlKeyword.h.
PvlKeyword & Isis::PvlKeyword::operator+= | ( | QString | value | ) |
Adds a value.
Overwrites the '+=' operators to add a new value. Like addValue(), this method keeps any previously existing values and adds the new value with unit = "" (empty QString) to the array of values for this PvlKeyword object.
value | The new value. |
Definition at line 342 of file PvlKeyword.cpp.
References addValue().
Referenced by operator=().
const PvlKeyword & Isis::PvlKeyword::operator= | ( | const PvlKeyword & | other | ) |
This is an assignment operator.
Definition at line 1886 of file PvlKeyword.cpp.
References m_comments, m_formatter, m_indent, m_name, m_units, m_values, m_width, and setName().
PvlKeyword & Isis::PvlKeyword::operator= | ( | Isis::PvlSequence & | seq | ) |
Add values and units from a PvlSequence.
(Clears current values and units)
seq | The PvlSequence to add from. |
Definition at line 633 of file PvlKeyword.cpp.
References clear(), operator+=(), and size().
PvlKeyword & Isis::PvlKeyword::operator= | ( | QString | value | ) |
Sets new values.
Overwrites the '=' operator to add a new value using addValue(). Like setValue(), this method clears any previously existing values and resets to the given value with unit = "" (empty QString).
value | The value to be added. |
Definition at line 247 of file PvlKeyword.cpp.
References addValue(), and clear().
|
inline |
Returns true of the keyword names match.
key | The keyword to compare names with |
Definition at line 179 of file PvlKeyword.h.
References m_name, and stringEqual().
QString & Isis::PvlKeyword::operator[] | ( | int | index | ) |
Gets value for this object at specified index.
Overrides the '[]' operator to return the element in the array of values at the specified index.
index | The index of the value. |
iException | ArraySubscriptNotInRange (index) Index out of bounds. |
Definition at line 375 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_name, m_values, and Isis::IException::Programmer.
const QString & Isis::PvlKeyword::operator[] | ( | int | index | ) | const |
Gets value for this object at specified index.
Overrides the '[]' operator to return the element in the array of values at the specified index.
index | The index of the value. |
iException | ArraySubscriptNotInRange (index) Index out of bounds. |
Definition at line 397 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_values, and Isis::IException::Programmer.
|
static |
This reads a keyword compressed back to 1 line of data (excluding comments, which are included on separate lines of data before the keyword).
Line concatenations must have already been handled. This returns the data of the keyword (if valid) and its status.
keyword | Pvl "#COMMENT\n//COMMENT\nKeyword = (Value1,Value2,...)" QString |
keywordComments | Output: Lines of data that are comments |
keywordName | Output: Name of keyword |
keywordValues | Output: vector< pair<Value, Units> > |
Definition at line 1180 of file PvlKeyword.cpp.
References comment(), comments(), and Isis::IException::Unknown.
|
static |
This method reads one line of data from the input stream.
All spaces, newlines, returns and tabs are trimmed from the result. Once a newline is encountered, if the line we read is blank, we keep reading. Once a line with data is encountered, that is the result. All newlines, spaces, returns and tabs are consumed past this line of data until the next different character (seeks to next valid data).
is | The stream to read from |
Definition at line 1768 of file PvlKeyword.cpp.
|
static |
Definition at line 1611 of file PvlKeyword.cpp.
|
static |
This method looks for a data element in the QString.
A data element is a quoted QString, a units value, or one value of an array (not including units). As an example, each value in the following QString is quoted:
'VALUE' '=' ('VALUE','VALUE', 'VALUE' '
')
The returned values of each of these elements is VALUE. Explicitly defined quotes (', ", <>) are stripped from the return value.
keyword | Input/Output: The keyword to get the next value from (DESTRUCTIVE) |
quoteProblem | Output: The QString has an unclosed quote character |
Definition at line 1633 of file PvlKeyword.cpp.
|
protected |
Checks if the value needs to be converted to PVL or iPVL and returns it in the correct format.
value | The value to be converted. |
Definition at line 515 of file PvlKeyword.cpp.
References toIPvl(), toPvl(), Isis::PvlObject::Traverse, and Isis::IString::UpCase().
void Isis::PvlKeyword::setFormat | ( | PvlFormat * | formatter | ) |
Set the PvlFormatter used to format the keyword name and value(s)
formatter | A pointer to the formatter to be used |
Definition at line 942 of file PvlKeyword.cpp.
References m_formatter.
|
inline |
Sets the indent level when outputted(for formatting)
indent | The new indent |
Definition at line 211 of file PvlKeyword.h.
void Isis::PvlKeyword::setJsonValue | ( | nlohmann::json | jsonobj, |
QString | unit = "" ) |
Sets new value from Json.
If no current value exists, this method sets the given json value to the PvlKeyword. Otherwise, it clears any existing values and resets to the value given using addJsonValue(). Defaults to unit = "" (empty QString).
jsonobj | New jsobobj to be parsed and assigned. |
unit | Units of measurement corresponding to the value. |
Definition at line 173 of file PvlKeyword.cpp.
References addJsonValue(), clear(), and unit().
Referenced by Isis::PvlObject::PvlObject().
void Isis::PvlKeyword::setName | ( | QString | name | ) |
Sets the keyword name.
name | The new keyword name. |
Definition at line 120 of file PvlKeyword.cpp.
References m_name, name(), and Isis::IException::User.
Referenced by Isis::Strategy::composite(), Isis::MosaicController::convertV1ToV2(), Isis::PvlToPvlTranslationManager::DoTranslation(), Isis::ProcessImportFits::extractFitsLabels(), Isis::fitsToJson(), operator=(), Isis::PvlContainer::PvlContainer(), Isis::PvlContainer::PvlContainer(), PvlKeyword(), PvlKeyword(), and Isis::PvlObject::PvlObject().
void Isis::PvlKeyword::setUnits | ( | QString | units | ) |
Sets the unit of measure for all current values if any exist.
units | New units to be assigned. |
Definition at line 184 of file PvlKeyword.cpp.
References m_units, and m_values.
Referenced by Isis::ProcessImportFits::extractFitsLabels(), and Isis::fitsToJson().
void Isis::PvlKeyword::setUnits | ( | QString | value, |
QString | units ) |
Sets the unit of measure for a given value.
value | The value to match |
units | New units to be assigned. |
Isis::iException::Programmer | - Given value must exist |
Definition at line 205 of file PvlKeyword.cpp.
References m_units, m_values, and Isis::IException::Programmer.
void Isis::PvlKeyword::setValue | ( | QString | value, |
QString | unit = "" ) |
Sets new values.
If no current value exists, this method sets the given value to the PvlKeyword. Otherwise, it clears any existing values and resets to the value given using addValue(). Defaults to unit = "" (empty QString).
value | New value to be assigned. |
unit | Units of measurement corresponding to the value. |
Definition at line 155 of file PvlKeyword.cpp.
References addValue(), clear(), and unit().
Referenced by Isis::PvlContainer::setName(), and Isis::ProcessExportPds::StandardAllMapping().
|
inline |
The width of the longest keyword name (for formatting)
width | the new width |
Definition at line 202 of file PvlKeyword.h.
|
inline |
Returns the number of values stored in this keyword.
Definition at line 133 of file PvlKeyword.h.
References m_values.
Referenced by Isis::ProcessMosaic::AddBandBinGroup(), Isis::PvlFlatMap::append(), Isis::DbProfile::count(), Isis::ProcessMosaic::GetBandIndex(), Isis::ImageOverlapSet::HandleError(), Isis::ImageOverlapSet::HandleError(), Isis::ImageOverlapSet::HandleError(), Isis::Spice::hasKernels(), Isis::PvlTranslationTable::InputGroup(), isNull(), Isis::PvlFormat::isSingleUnit(), Isis::PvlFlatMap::keywordValues(), Isis::Spice::load(), Isis::LroWideAngleCamera::LroWideAngleCamera(), Isis::KernelDb::matches(), Isis::PvlSequence::operator+=(), operator=(), Isis::PvlSequence::operator=(), Isis::pvlKeywordToJSON(), Isis::ProcessExportPds4::translateBandBinSpectrumBinSet(), and Isis::ProcessExportPds4::translateBandBinSpectrumUniform().
|
static |
Checks to see if two QStrings are equal.
Each is converted to uppercase and removed of underscores and whitespaces.
QString1 | The first QString |
QString2 | The second QString |
Definition at line 592 of file PvlKeyword.cpp.
Referenced by Isis::PvlToPvlTranslationManager::GetContainer(), Isis::PvlToXmlTranslationManager::GetContainer(), isEquivalent(), Isis::PvlContainer::isNamed(), isNamed(), isNull(), Isis::PvlFormat::isSingleUnit(), Isis::PvlGroup::operator==(), operator==(), and Isis::PvlObject::operator==().
|
protected |
Converts a value to iPVL format.
value | The value to be converted. |
Definition at line 539 of file PvlKeyword.cpp.
Referenced by reform().
|
protected |
Converts a value to PVL format.
value | The value to be converted. |
Definition at line 567 of file PvlKeyword.cpp.
Referenced by reform().
QString Isis::PvlKeyword::unit | ( | const int | index = 0 | ) | const |
Returns the units of measurement of the element of the array of values for the object at the specified index.
Defaults to index = 0.
index | The index of the unit. |
iException | ArraySubscriptNotInRange (index) Index out of bounds. |
Definition at line 414 of file PvlKeyword.cpp.
References Isis::Message::ArraySubscriptNotInRange(), m_units, and Isis::IException::Programmer.
Referenced by addJsonValue(), addValue(), Isis::PvlFormat::isSingleUnit(), PvlKeyword(), Isis::pvlKeywordToJSON(), setJsonValue(), setValue(), Isis::ProcessExportPds::StandardAllMapping(), and Isis::ProcessExportPds4::translateBandBinSpectrumUniform().
void Isis::PvlKeyword::validateKeyword | ( | PvlKeyword & | pvlKwrd, |
QString | psValueType = "", | ||
PvlKeyword * | pvlKwrdValue = NULL ) |
Validate Keyword for type and required values.
Validate a Keyword, comparing against corresponding Template Keyword.
Template Keyword has the format: keyName = (valueType, optional/required, Values allowed separated by comma)
pvlKwrd | - Keyword to be validated |
psValueType | - Value Type (positive / negative) for numbers |
pvlKwrdValue | - Template Keyword __Value or __Range to validate keyword's value |
Definition at line 1938 of file PvlKeyword.cpp.
References m_values, name(), Isis::toDouble(), Isis::toInt(), and Isis::IException::User.
|
inline |
Returns the current set longest keyword name.
Definition at line 216 of file PvlKeyword.h.
References m_width.
Referenced by setWidth().
|
private |
This writes numSpaces spaces to the ostream.
os | Stream to write to |
numSpaces | number of spaces to write |
Definition at line 929 of file PvlKeyword.cpp.
Referenced by writeWithWrap().
|
protected |
Wraps output so that length doesn't exceed the character limit.
By default, the character limit is set to 80, and can be changed with the method SetCharLimit. Used as a helper method for output of PvlKeyword.
os | Designated output stream |
textToWrite | The text to be written |
startColumn | The starting column after the "=" sign. |
endOfLine | The EOL character |
Definition at line 668 of file PvlKeyword.cpp.
References Isis::PvlFormat::charLimit(), format(), and writeSpaces().
|
friend |
Write out the keyword.
os | The output stream. |
keyword | The PvlKeyword object to output. |
Definition at line 1830 of file PvlKeyword.cpp.
|
friend |
Read in a keyword.
http://pds.jpl.nasa.gov/tools/standards-reference.shtml
is | The input stream |
result | The keyword to read into (OUTPUT) |
Definition at line 966 of file PvlKeyword.cpp.
|
private |
The comments for the keyword.
Definition at line 282 of file PvlKeyword.h.
Referenced by addComment(), clearComment(), comment(), comments(), init(), operator=(), and ~PvlKeyword().
|
protected |
Formatter object.
Definition at line 262 of file PvlKeyword.h.
Referenced by format(), init(), operator=(), and setFormat().
|
private |
The number of indentations to make.
This is based on whether the keyword is in a group, etc.
Definition at line 297 of file PvlKeyword.h.
Referenced by indent(), init(), operator=(), and setIndent().
|
private |
The keyword's name... This is a c-string for memory efficiency.
Definition at line 266 of file PvlKeyword.h.
Referenced by init(), name(), Isis::PvlContainer::operator=(), operator=(), operator==(), operator[](), setName(), and ~PvlKeyword().
|
private |
The units for the values.
Definition at line 279 of file PvlKeyword.h.
Referenced by addValue(), clear(), init(), operator=(), setUnits(), setUnits(), unit(), and ~PvlKeyword().
|
private |
The values in the keyword.
This is a QVarLengthArray purely for optimization purposes. The amount of memory consumed by other data types introduces very significant overhead relative to this type which is meant to be as cost-effective and cheap as possible. Most of the time we have one value per keyword so that is what we're allocating by default with this variable.
Definition at line 276 of file PvlKeyword.h.
Referenced by addValue(), clear(), isEquivalent(), isNull(), operator=(), operator[](), operator[](), setUnits(), setUnits(), size(), and validateKeyword().
|
private |
The width of the longest keyword.
This is used for spacing out the equals signs on output.
Definition at line 292 of file PvlKeyword.h.
Referenced by init(), operator=(), setWidth(), and width().