Isis 3.0 Developer's Reference (API) |
Home |
Formats the value of a PvlKeyword into a PDS complient string. More...
#include <PvlFormatPds.h>
Inherits Isis::PvlFormat.
Public Member Functions | |
PvlFormatPds () | |
PvlFormatPds (const std::string &file) | |
PvlFormatPds (Pvl &keymap) | |
virtual | ~PvlFormatPds () |
virtual std::string | FormatValue (const PvlKeyword &keyword, int valueIndex=0) |
virtual std::string | FormatName (const PvlKeyword &keyword) |
virtual std::string | FormatEnd (const std::string name, const PvlKeyword &keyword) |
virtual std::string | FormatEOL () |
void | Add (const std::string &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 KeywordType | Type (const PvlKeyword &keyword) |
virtual int | Accuracy (const PvlKeyword &keyword) |
Protected Member Functions | |
virtual std::string | AddQuotes (const std::string value) |
std::string | FormatString (const PvlKeyword &keyword, int num) |
std::string | FormatInteger (const PvlKeyword &keyword, int num, int bytes) |
std::string | FormatReal (const PvlKeyword &keyword, int num, int precision) |
std::string | FormatEnum (const PvlKeyword &keyword, int num) |
std::string | FormatBinary (const PvlKeyword &keyword, int num, int bytes) |
std::string | FormatHex (const PvlKeyword &keyword, int num, int bytes) |
std::string | FormatBool (const PvlKeyword &keyword, int num) |
std::string | FormatUnknown (const PvlKeyword &keyword, int num) |
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 | |
std::string | p_keywordMapFile |
Pvl | p_keywordMap |
unsigned int | p_charLimit |
Maximum number of characters on a single line of a keyword value. |
Formats the value of a PvlKeyword into a PDS complient string.
This class is used to format a single PVL keyword-value pair. The supported formats are Normal and PDS. The keyword to type mapping is not defined until a Pvl or Pvl formatted file is supplied.
Isis::PvlFormatPds::PvlFormatPds | ( | ) |
Isis::PvlFormatPds::PvlFormatPds | ( | const std::string & | file | ) |
Isis::PvlFormatPds::PvlFormatPds | ( | Pvl & | keymap | ) |
virtual Isis::PvlFormatPds::~PvlFormatPds | ( | ) | [inline, virtual] |
int Isis::PvlFormat::Accuracy | ( | const PvlKeyword & | keyword | ) | [virtual, inherited] |
void Isis::PvlFormat::Add | ( | Pvl & | keymap | ) | [inherited] |
void Isis::PvlFormat::Add | ( | const std::string & | file | ) | [inherited] |
References _FILEINFO_, Isis::iException::Message(), Isis::PvlFormat::p_keywordMapFile, Isis::iException::Programmer, and pvl().
Referenced by Isis::PvlFormat::PvlFormat().
std::string Isis::PvlFormatPds::AddQuotes | ( | const std::string | value | ) | [protected, virtual] |
Reimplemented from Isis::PvlFormat.
Referenced by FormatString(), and FormatUnknown().
unsigned int Isis::PvlFormat::CharLimit | ( | ) | const [inline, inherited] |
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 Isis::PvlFormat::p_charLimit.
Referenced by Isis::PvlKeyword::WriteWithWrap().
std::string Isis::PvlFormatPds::FormatBinary | ( | const PvlKeyword & | keyword, | |
int | num, | |||
int | bytes | |||
) | [protected] |
References right, size, Isis::PvlKeyword::Size(), ss, Isis::PvlKeyword::Unit(), Isis::iString::UpCase(), and value.
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatBool | ( | const PvlKeyword & | keyword, | |
int | num | |||
) | [protected] |
References size, Isis::PvlKeyword::Size(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatEnd | ( | const std::string | name, | |
const PvlKeyword & | keyword | |||
) | [virtual] |
Reimplemented from Isis::PvlFormat.
References left, right, and Isis::iString::UpCase().
std::string Isis::PvlFormatPds::FormatEnum | ( | const PvlKeyword & | keyword, | |
int | num | |||
) | [protected] |
References size, Isis::PvlKeyword::Size(), Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
virtual std::string Isis::PvlFormatPds::FormatEOL | ( | ) | [inline, virtual] |
Reimplemented from Isis::PvlFormat.
std::string Isis::PvlFormatPds::FormatHex | ( | const PvlKeyword & | keyword, | |
int | num, | |||
int | bytes | |||
) | [protected] |
References size, Isis::PvlKeyword::Size(), ss, Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatInteger | ( | const PvlKeyword & | keyword, | |
int | num, | |||
int | bytes | |||
) | [protected] |
References size, Isis::PvlKeyword::Size(), Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatName | ( | const PvlKeyword & | keyword | ) | [virtual] |
Reimplemented from Isis::PvlFormat.
References Isis::PvlKeyword::Name(), and Isis::iString::UpCase().
std::string Isis::PvlFormatPds::FormatReal | ( | const PvlKeyword & | keyword, | |
int | num, | |||
int | precision | |||
) | [protected] |
References out, size, Isis::PvlKeyword::Size(), Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatString | ( | const PvlKeyword & | keyword, | |
int | num | |||
) | [protected] |
References AddQuotes(), size, Isis::PvlKeyword::Size(), Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatUnknown | ( | const PvlKeyword & | keyword, | |
int | num | |||
) | [protected] |
References AddQuotes(), size, Isis::PvlKeyword::Size(), Isis::PvlKeyword::Unit(), and Isis::iString::UpCase().
Referenced by FormatValue().
std::string Isis::PvlFormatPds::FormatValue | ( | const PvlKeyword & | keyword, | |
int | valueIndex = 0 | |||
) | [virtual] |
Reimplemented from Isis::PvlFormat.
References Isis::PvlFormat::Accuracy(), Isis::BinaryKeyword, Isis::BoolKeyword, Isis::EnumKeyword, FormatBinary(), FormatBool(), FormatEnum(), FormatHex(), FormatInteger(), FormatReal(), FormatString(), FormatUnknown(), Isis::HexKeyword, Isis::IntegerKeyword, Isis::PvlKeyword::Name(), Isis::NoTypeKeyword, Isis::RealKeyword, Isis::StringKeyword, Isis::PvlFormat::Type(), and Isis::iString::UpCase().
bool Isis::PvlFormat::IsSingleUnit | ( | const PvlKeyword & | keyword | ) | [protected, inherited] |
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 Isis::PvlFormat::FormatValue().
void Isis::PvlFormat::SetCharLimit | ( | const unsigned int | limit | ) | [inline, inherited] |
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 Isis::PvlFormat::p_charLimit.
KeywordType Isis::PvlFormat::Type | ( | const PvlKeyword & | keyword | ) | [virtual, inherited] |
unsigned int Isis::PvlFormat::p_charLimit [protected, inherited] |
Maximum number of characters on a single line of a keyword value.
Referenced by Isis::PvlFormat::CharLimit(), and Isis::PvlFormat::SetCharLimit().
Pvl Isis::PvlFormat::p_keywordMap [protected, inherited] |
Referenced by Isis::PvlFormat::Accuracy(), Isis::PvlFormat::Add(), and Isis::PvlFormat::Type().
std::string Isis::PvlFormat::p_keywordMapFile [protected, inherited] |
Referenced by Isis::PvlFormat::Add().