USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::PvlFormat Class Reference
[Parsing]

Formats a Pvl name value pair to Isis standards. More...

#include <PvlFormat.h>

Inherited by Isis::PvlFormatPds.

List of all members.

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 p_keywordMapFile
Pvl p_keywordMap
unsigned int p_charLimit
 Maximum number of characters on a single line of a keyword value.

Detailed Description

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:

 NAME=TYPE
 NAME2=(TYPE,PLACES)

Example:

   DESCRIPTION = STRING
   MinimumLatitude = (REAL,5)
   BITTYPE = ENUM
   RECORDS = INTEGER

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.

Author:
2006-09-05 Stuart Sides

Constructor & Destructor Documentation

Isis::PvlFormat::PvlFormat (  ) 
Isis::PvlFormat::PvlFormat ( const QString &  file  ) 

References Add().

Isis::PvlFormat::PvlFormat ( Pvl keymap  ) 

References Add().

virtual Isis::PvlFormat::~PvlFormat (  )  [inline, virtual]

Member Function Documentation

int Isis::PvlFormat::Accuracy ( const PvlKeyword keyword  )  [virtual]
void Isis::PvlFormat::Add ( Pvl keymap  ) 
void Isis::PvlFormat::Add ( const QString &  file  ) 
QString Isis::PvlFormat::AddQuotes ( const QString  value  )  [protected, virtual]

Reimplemented in Isis::PvlFormatPds.

References pos.

Referenced by FormatValue().

unsigned int Isis::PvlFormat::CharLimit (  )  const [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.

Returns:
unsigned int Maximum number of characters.

References p_charLimit.

Referenced by Isis::PvlKeyword::WriteWithWrap().

QString Isis::PvlFormat::FormatEnd ( const QString  name,
const PvlKeyword keyword 
) [virtual]

Reimplemented in Isis::PvlFormatPds.

References FormatName().

Referenced by Isis::operator<<().

virtual QString Isis::PvlFormat::FormatEOL (  )  [inline, virtual]
QString Isis::PvlFormat::FormatName ( const PvlKeyword keyword  )  [virtual]

Reimplemented in Isis::PvlFormatPds.

References Isis::PvlKeyword::Name().

Referenced by FormatEnd(), and Isis::operator<<().

QString Isis::PvlFormat::FormatValue ( const PvlKeyword keyword,
int  valueIndex = 0 
) [virtual]
bool Isis::PvlFormat::IsSingleUnit ( const PvlKeyword keyword  )  [protected]

Returns true if the units are the same for all value in the keyword otherwise it returns false.

Parameters:
keyword The PvlKeyword to be formatted

References Isis::PvlKeyword::Size(), Isis::PvlKeyword::StringEqual(), and Isis::PvlKeyword::Unit().

Referenced by FormatValue().

void Isis::PvlFormat::SetCharLimit ( const unsigned int  limit  )  [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.

Parameters:
limit The new character limit.

References p_charLimit.

KeywordType Isis::PvlFormat::Type ( const PvlKeyword keyword  )  [virtual]

Member Data Documentation

unsigned int Isis::PvlFormat::p_charLimit [protected]

Maximum number of characters on a single line of a keyword value.

Referenced by CharLimit(), and SetCharLimit().

Referenced by Accuracy(), Add(), and Type().

QString Isis::PvlFormat::p_keywordMapFile [protected]

Referenced by Add().


The documentation for this class was generated from the following files: