|
Isis 3.0 Object Programmers' Reference |
Home |
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 | 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. | |
| 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 | ClearComments () |
| 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 * | GetFormat () |
| 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 * | p_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 * | p_name |
| The keyword's name... This is a c-string for memory efficiency. | |
| QVarLengthArray< QString, 1 > | p_values |
| The values in the keyword. | |
| std::vector< QString > * | p_units |
| The units for the values. | |
| std::vector< QString > * | p_comments |
| The comments for the keyword. | |
| int | p_width |
| The width of the longest keyword. | |
| int | p_indent |
| The number of indentations to make. | |
Friends | |
| std::istream & | operator>> (std::istream &is, PvlKeyword &result) |
| std::ostream & | operator<< (std::ostream &os, const PvlKeyword &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.
For internal use only.
Definition at line 95 of file PvlKeyword.h.
| Isis::PvlKeyword::PvlKeyword | ( | ) |
Constructs a blank PvlKeyword object.
Definition at line 38 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 48 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 62 of file PvlKeyword.cpp.
References AddValue(), Init(), and SetName().
| Isis::PvlKeyword::PvlKeyword | ( | const PvlKeyword & | other | ) |
| Isis::PvlKeyword::~PvlKeyword | ( | ) |
Destructs a PvlKeyword object.
Definition at line 80 of file PvlKeyword.cpp.
References p_comments, p_name, and p_units.
| void Isis::PvlKeyword::AddComment | ( | QString | comment | ) |
Add a comment to the PvlKeyword.
| comment | The new comment. |
Definition at line 392 of file PvlKeyword.cpp.
References p_comments.
Referenced by AddComments(), AddCommentWrapped(), Isis::CameraPointInfo::GetPointInfo(), and Isis::ControlNetFileV0002::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 1109 of file PvlKeyword.cpp.
References AddComment().
Referenced by Isis::operator>>().
| void Isis::PvlKeyword::AddCommentWrapped | ( | QString | comment | ) |
Automatically wraps and adds long comments to the PvlKeyword.
| comment | The new comment to add |
Definition at line 426 of file PvlKeyword.cpp.
References AddComment(), and Isis::IString::Token().
| 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 p_units, and p_values.
Referenced by Isis::DbProfile::add(), Isis::ControlNetDiff::addUniqueMeasure(), Isis::ControlNetDiff::addUniquePoint(), IsisAml::CommandLine(), Isis::PvlTranslationManager::DoTranslation(), Isis::UserInterface::EvaluateOption(), Isis::CameraPointInfo::GetPointInfo(), Isis::DawnVirCamera::getPointingTable(), Isis::ControlNetDiff::makeKeyword(), operator+=(), operator=(), Isis::operator>>(), PvlKeyword(), and SetValue().
| void Isis::PvlKeyword::Clear | ( | ) |
Clears all values and units for this PvlKeyword object.
Definition at line 307 of file PvlKeyword.cpp.
References p_units, and p_values.
Referenced by Init(), operator=(), and SetValue().
| void Isis::PvlKeyword::ClearComments | ( | ) |
| 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 457 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_comments, and Isis::IException::Programmer.
Referenced by Isis::operator<<().
| int Isis::PvlKeyword::Comments | ( | ) | const [inline] |
Returns the number of lines of comments associated with this keyword.
Definition at line 173 of file PvlKeyword.h.
Referenced by Isis::operator<<().
| PvlFormat * Isis::PvlKeyword::GetFormat | ( | ) |
Get the current PvlFormat or create one.
Definition at line 903 of file PvlKeyword.cpp.
References p_formatter.
| int Isis::PvlKeyword::Indent | ( | ) | const [inline] |
Returns the current indent level.
Definition at line 226 of file PvlKeyword.h.
Referenced by Isis::operator<<().
| void Isis::PvlKeyword::Init | ( | ) | [private] |
Clears all PvlKeyword data.
Definition at line 99 of file PvlKeyword.cpp.
References Clear(), p_comments, p_formatter, p_indent, p_name, p_units, and p_width.
Referenced by 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 578 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_values, Isis::IException::Programmer, and StringEqual().
| bool Isis::PvlKeyword::IsNamed | ( | QString | name | ) | const [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 123 of file PvlKeyword.h.
References Name(), and StringEqual().
Referenced by 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 118 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_values, Isis::IException::Programmer, Size(), and StringEqual().
Referenced by Isis::Kernels::findKernels().
| QString Isis::PvlKeyword::Name | ( | ) | const [inline] |
Returns the keyword name.
Definition at line 111 of file PvlKeyword.h.
References p_name.
Referenced by Isis::ProcessMosaic::AddBandBinGroup(), Isis::PvlContainer::AddKeyword(), Isis::PvlTranslationTable::AddTable(), Isis::ControlNetDiff::compare(), Isis::ControlMeasureLogData::ControlMeasureLogData(), Isis::KernelDb::files(), Isis::PvlTranslationManager::InputKeyword(), IsNamed(), Isis::ProcessMosaic::MatchBandBinGroup(), Isis::PvlContainer::operator-=(), Isis::operator>>(), Isis::PvlContainer::Type(), Isis::PvlContainer::ValidateAllKeywords(), ValidateKeyword(), and Isis::PvlContainer::ValidateRepeatOption().
| Isis::PvlKeyword::operator double | ( | ) | const [inline] |
Returns the first value in this keyword converted to a double.
Definition at line 149 of file PvlKeyword.h.
References Isis::toDouble().
| Isis::PvlKeyword::operator int | ( | ) | const [inline] |
Returns the first value in this keyword converted to an integer.
Definition at line 153 of file PvlKeyword.h.
References Isis::toInt().
| Isis::PvlKeyword::operator Isis::BigInt | ( | ) | const [inline] |
Returns the first value in this keyword converted to a BigInt.
Definition at line 157 of file PvlKeyword.h.
References Isis::toBigInt().
| bool Isis::PvlKeyword::operator!= | ( | const PvlKeyword & | key | ) | const [inline] |
Returns true of the keyword names do not match.
| key | The keyword to compare names with |
Definition at line 196 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 301 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 1828 of file PvlKeyword.cpp.
References p_comments, p_formatter, p_indent, p_name, p_units, p_values, p_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 592 of file PvlKeyword.cpp.
References Clear(), operator+=(), size, and Isis::PvlSequence::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().
| bool Isis::PvlKeyword::operator== | ( | const PvlKeyword & | key | ) | const [inline] |
Returns true of the keyword names match.
| key | The keyword to compare names with |
Definition at line 184 of file PvlKeyword.h.
References p_name.
| 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 334 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_name, p_values, Isis::IException::Programmer, and Isis::toString().
| 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 356 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_values, and Isis::IException::Programmer.
| bool Isis::PvlKeyword::ReadCleanKeyword | ( | QString | keyword, | |
| std::vector< QString > & | keywordComments, | |||
| QString & | keywordName, | |||
| std::vector< std::pair< QString, QString > > & | keywordValues | |||
| ) | [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 1130 of file PvlKeyword.cpp.
References _FILEINFO_, trimmed, and Isis::IException::Unknown.
Referenced by Isis::operator>>().
| QString Isis::PvlKeyword::ReadLine | ( | std::istream & | is, | |
| bool | insideComment | |||
| ) | [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 1710 of file PvlKeyword.cpp.
Referenced by Isis::operator>>().
| QString Isis::PvlKeyword::ReadValue | ( | QString & | keyword, | |
| bool & | quoteProblem, | |||
| const std::vector< std::pair< char, char > > & | otherDelimiters | |||
| ) | [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 1575 of file PvlKeyword.cpp.
| QString Isis::PvlKeyword::Reform | ( | const QString & | value | ) | const [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 474 of file PvlKeyword.cpp.
References Isis::PvlObject::FindGroup(), g, 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 892 of file PvlKeyword.cpp.
References p_formatter.
| void Isis::PvlKeyword::SetIndent | ( | int | indent | ) | [inline] |
Sets the indent level when outputted(for formatting).
| indent | The new indent |
Definition at line 216 of file PvlKeyword.h.
| void Isis::PvlKeyword::SetName | ( | QString | name | ) |
Sets the keyword name.
| name | The new keyword name. |
Definition at line 136 of file PvlKeyword.cpp.
References _FILEINFO_, p_name, and Isis::IException::User.
Referenced by Isis::PvlTranslationManager::DoTranslation(), operator=(), Isis::operator>>(), Isis::PvlContainer::PvlContainer(), and PvlKeyword().
| 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 203 of file PvlKeyword.cpp.
References _FILEINFO_, p_units, p_values, and Isis::IException::Programmer.
| 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 182 of file PvlKeyword.cpp.
References p_units, and p_values.
Referenced by Isis::ProcessMosaic::AddBandBinGroup().
| 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 171 of file PvlKeyword.cpp.
References AddValue(), and Clear().
Referenced by Isis::CameraPointInfo::GetPointInfo(), and Isis::PvlContainer::SetName().
| void Isis::PvlKeyword::SetWidth | ( | int | width | ) | [inline] |
The width of the longest keyword name (for formatting).
| width | the new width |
Definition at line 207 of file PvlKeyword.h.
| int Isis::PvlKeyword::Size | ( | ) | const [inline] |
Returns the number of values stored in this keyword.
Definition at line 138 of file PvlKeyword.h.
References p_values.
Referenced by Isis::ProcessMosaic::AddBandBinGroup(), Isis::PvlTranslationTable::AddTable(), Isis::DbProfile::count(), Isis::KernelDb::files(), Isis::Kernels::findKernels(), Isis::CubeViewport::getAllWhatsThisInfo(), Isis::ProcessMosaic::GetBandIndex(), Isis::SpectralPlotTool::getSpectralStatistics(), Isis::ImageOverlapSet::HandleError(), Isis::Spice::hasKernels(), Isis::PvlTranslationTable::InputGroup(), Isis::PvlTranslationManager::InputKeyword(), IsNull(), Isis::PvlFormat::IsSingleUnit(), Isis::Stretch::Load(), Isis::Spice::load(), Isis::LroWideAngleCamera::LroWideAngleCamera(), Isis::MarciCamera::MarciCamera(), Isis::ProcessMosaic::MatchBandBinGroup(), Isis::KernelDb::matches(), Isis::PvlSequence::operator+=(), Isis::operator<<(), Isis::PvlSequence::operator=(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::LoCameraFiducialMap::ReadFiducials(), Isis::ReseauDistortionMap::ReseauDistortionMap(), Isis::ThemisIrCamera::ThemisIrCamera(), Isis::ThemisVisCamera::ThemisVisCamera(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::CubeViewport::updateWhatsThis(), and ValidateKeyword().
| bool Isis::PvlKeyword::StringEqual | ( | const QString & | QString1, | |
| const QString & | QString2 | |||
| ) | [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 551 of file PvlKeyword.cpp.
References Isis::IString::ConvertWhiteSpace(), Isis::IString::Remove(), s1, s2, and Isis::IString::UpCase().
Referenced by IsEquivalent(), IsNamed(), Isis::PvlContainer::IsNamed(), IsNull(), Isis::PvlFormat::IsSingleUnit(), Isis::PvlObject::operator==(), and Isis::PvlGroup::operator==().
| QString Isis::PvlKeyword::ToIPvl | ( | const QString & | value | ) | const [protected] |
Converts a value to iPVL format.
| value | The value to be converted. |
Definition at line 498 of file PvlKeyword.cpp.
References out.
Referenced by Reform().
| QString Isis::PvlKeyword::ToPvl | ( | const QString & | value | ) | const [protected] |
Converts a value to PVL format.
| value | The value to be converted. |
Definition at line 526 of file PvlKeyword.cpp.
References out.
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 373 of file PvlKeyword.cpp.
References _FILEINFO_, Isis::Message::ArraySubscriptNotInRange(), p_units, and Isis::IException::Programmer.
Referenced by Isis::ProcessMosaic::AddBandBinGroup(), Isis::ProcessImportPds::ExtractPdsProjection(), Isis::PvlFormat::IsSingleUnit(), and Isis::ProcessImportPds::ProcessDataFilePointer().
| 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 1880 of file PvlKeyword.cpp.
References _FILEINFO_, Name(), p_values, Size(), Isis::toDouble(), Isis::toInt(), and Isis::IException::User.
Referenced by Isis::PvlContainer::ValidateAllKeywords(), and Isis::PvlContainer::ValidateRepeatOption().
| int Isis::PvlKeyword::Width | ( | ) | const [inline] |
Returns the current set longest keyword name.
Definition at line 221 of file PvlKeyword.h.
Referenced by Isis::operator<<().
| void Isis::PvlKeyword::WriteSpaces | ( | std::ostream & | os, | |
| int | numSpaces | |||
| ) | const [private] |
This writes numSpaces spaces to the ostream.
| os | Stream to write to | |
| numSpaces | number of spaces to write |
Definition at line 879 of file PvlKeyword.cpp.
Referenced by WriteWithWrap().
| ostream & Isis::PvlKeyword::WriteWithWrap | ( | std::ostream & | os, | |
| const QString & | textToWrite, | |||
| int | startColumn, | |||
| PvlFormat & | format | |||
| ) | const [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 627 of file PvlKeyword.cpp.
References Isis::PvlFormat::CharLimit(), pos, and WriteSpaces().
Referenced by Isis::operator<<().
std::vector<QString>* Isis::PvlKeyword::p_comments [private] |
The comments for the keyword.
Definition at line 287 of file PvlKeyword.h.
Referenced by AddComment(), ClearComments(), Comment(), Init(), operator=(), and ~PvlKeyword().
PvlFormat* Isis::PvlKeyword::p_formatter [protected] |
Formatter object.
Definition at line 267 of file PvlKeyword.h.
Referenced by GetFormat(), Init(), Isis::operator<<(), operator=(), and SetFormat().
int Isis::PvlKeyword::p_indent [private] |
The number of indentations to make.
This is based on whether the keyword is in a group, etc.
Definition at line 302 of file PvlKeyword.h.
Referenced by Init(), and operator=().
char* Isis::PvlKeyword::p_name [private] |
The keyword's name... This is a c-string for memory efficiency.
Definition at line 271 of file PvlKeyword.h.
Referenced by Init(), Name(), operator=(), operator==(), operator[](), SetName(), and ~PvlKeyword().
std::vector<QString>* Isis::PvlKeyword::p_units [private] |
The units for the values.
Definition at line 284 of file PvlKeyword.h.
Referenced by AddValue(), Clear(), Init(), operator=(), SetUnits(), Unit(), and ~PvlKeyword().
QVarLengthArray<QString, 1> Isis::PvlKeyword::p_values [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 281 of file PvlKeyword.h.
Referenced by AddValue(), Clear(), IsEquivalent(), IsNull(), operator=(), operator[](), SetUnits(), Size(), and ValidateKeyword().
int Isis::PvlKeyword::p_width [private] |
The width of the longest keyword.
This is used for spacing out the equals signs on output.
Definition at line 297 of file PvlKeyword.h.
Referenced by Init(), and operator=().