Isis Developer Reference
|
Formats a Pvl name value pair to Isis standards. More...
#include <PvlFormat.h>
Public Member Functions | |
PvlFormat () | |
PvlFormat (const QString &file) | |
PvlFormat (Pvl &keymap) | |
virtual | ~PvlFormat () |
void | add (const QString &file) |
void | add (Pvl &keymap) |
void | setCharLimit (const unsigned int limit) |
Sets the maximum number of characters in a keyword value that can be printed to a line before it wraps to the next line. | |
unsigned int | charLimit () const |
Retrieves the maximum number of characters in a keyword value that can be printed to a line before it wraps to the next line. | |
virtual QString | formatValue (const PvlKeyword &keyword, int valueIndex=0) |
virtual QString | formatName (const PvlKeyword &keyword) |
virtual QString | formatEnd (const QString name, const PvlKeyword &keyword) |
virtual QString | formatEOL () |
virtual KeywordType | type (const PvlKeyword &keyword) |
virtual int | accuracy (const PvlKeyword &keyword) |
Protected Member Functions | |
virtual QString | addQuotes (const QString value) |
bool | isSingleUnit (const PvlKeyword &keyword) |
Returns true if the units are the same for all value in the keyword otherwise it returns false. | |
Protected Attributes | |
QString | m_keywordMapFile |
Pvl | m_keywordMap |
unsigned int | m_charLimit |
Maximum number of characters on a single line of a keyword value. | |
Formats a Pvl name value pair to Isis standards.
This class is used to format a single PVL keyword-value pair using normal Isis formatting. The class serves as a base class for others to override and implement their own formatting.
This class uses a Pvl or Pvl formatted file to populate its internal data structure. This structure is used to lookup the type of a keyword and/or other information for another Pvl{Object|Group|Keyword}. The format of the file or Pvl is:
Example:
Where NAME is the name of a keyword in the Pvl to be formatted. TYPE is the type of keyword (STRING,BOOL,INTEGER,REAL,OCTAL,HEX,BINARY,ENUM) (see ToKeywordType). PLACES is the number of digits to the right of the decimal place for a keyword of TYPE REAL.
NOTE: The capabilities to use this Pvl are not implemented in this base class. They are provided as a convience for child classes only. This class only implements the normal Isis foramatting, which is not dependent on the type of the keyword. It is dependent on value of the keyword.
Isis::PvlFormat::PvlFormat | ( | ) |
Isis::PvlFormat::PvlFormat | ( | const QString & | file | ) |
References add().
|
inlinevirtual |
|
virtual |
References Isis::PvlObject::findKeyword(), Isis::PvlObject::hasKeyword(), m_keywordMap, Isis::PvlKeyword::name(), Isis::PvlKeyword::size(), and Isis::toInt().
Referenced by Isis::PvlFormatPds::formatValue().
void Isis::PvlFormat::add | ( | const QString & | file | ) |
References _FILEINFO_, add(), m_keywordMapFile, and Isis::IException::Programmer.
Referenced by add(), PvlFormat(), and PvlFormat().
void Isis::PvlFormat::add | ( | Pvl & | keymap | ) |
|
protectedvirtual |
Reimplemented in Isis::PvlFormatPds.
Referenced by Isis::PvlFormatPds::formatUnknown(), and formatValue().
|
inline |
Retrieves the maximum number of characters in a keyword value that can be printed to a line before it wraps to the next line.
By default, the limit is set to 80 characters.
References m_charLimit.
Referenced by Isis::PvlKeyword::writeWithWrap().
|
virtual |
Reimplemented in Isis::PvlFormatPds.
References formatName().
|
inlinevirtual |
Reimplemented in Isis::PvlFormatPds.
Referenced by Isis::Pvl::append(), Isis::ProcessExportPds::LabelSize(), Isis::ProcessExportPds::OutputLabel(), Isis::Pvl::write(), and Isis::PvlKeyword::writeWithWrap().
|
virtual |
Reimplemented in Isis::PvlFormatPds.
References Isis::PvlKeyword::name().
Referenced by formatEnd().
|
virtual |
Reimplemented in Isis::PvlFormatPds.
References addQuotes(), isSingleUnit(), Isis::PvlKeyword::size(), and Isis::PvlKeyword::unit().
|
protected |
Returns true if the units are the same for all value in the keyword otherwise it returns false.
keyword | The PvlKeyword to be formatted |
References Isis::PvlKeyword::size(), Isis::PvlKeyword::stringEqual(), and Isis::PvlKeyword::unit().
Referenced by formatValue().
|
inline |
Sets the maximum number of characters in a keyword value that can be printed to a line before it wraps to the next line.
By default, the limit is set to 80 characters.
limit | The new character limit. |
References m_charLimit.
|
virtual |
References Isis::PvlObject::findKeyword(), Isis::PvlObject::hasKeyword(), m_keywordMap, Isis::PvlKeyword::name(), Isis::NoTypeKeyword, and Isis::toKeywordType().
Referenced by add(), and Isis::PvlFormatPds::formatValue().
|
protected |
Maximum number of characters on a single line of a keyword value.
Referenced by charLimit(), and setCharLimit().
|
protected |
Referenced by accuracy(), add(), and type().
|
protected |
Referenced by add().