Isis 3 Developer Reference
Isis::PvlFormat Class Reference

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

#include <PvlFormat.h>

Inheritance diagram for Isis::PvlFormat:
Inheritance graph
Collaboration diagram for Isis::PvlFormat:
Collaboration graph

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. More...
 
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. More...
 
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. More...
 

Protected Attributes

QString m_keywordMapFile
 
Pvl m_keywordMap
 
unsigned int m_charLimit
 Maximum number of characters on a single line of a keyword value. More...
 

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

◆ PvlFormat() [1/3]

Isis::PvlFormat::PvlFormat ( )

◆ PvlFormat() [2/3]

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

◆ PvlFormat() [3/3]

Isis::PvlFormat::PvlFormat ( Pvl keymap)

◆ ~PvlFormat()

virtual Isis::PvlFormat::~PvlFormat ( )
inlinevirtual

Member Function Documentation

◆ accuracy()

int Isis::PvlFormat::accuracy ( const PvlKeyword keyword)
virtual

◆ add() [1/2]

◆ add() [2/2]

◆ addQuotes()

QString Isis::PvlFormat::addQuotes ( const QString  value)
protectedvirtual

Reimplemented in Isis::PvlFormatPds.

Referenced by Isis::PvlFormatPds::formatUnknown().

◆ charLimit()

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 m_charLimit.

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

◆ formatEnd()

QString Isis::PvlFormat::formatEnd ( const QString  name,
const PvlKeyword keyword 
)
virtual

Reimplemented in Isis::PvlFormatPds.

Referenced by Isis::operator<<().

◆ formatEOL()

virtual QString Isis::PvlFormat::formatEOL ( )
inlinevirtual

◆ formatName()

QString Isis::PvlFormat::formatName ( const PvlKeyword keyword)
virtual

Reimplemented in Isis::PvlFormatPds.

References Isis::PvlKeyword::name().

Referenced by Isis::operator<<().

◆ formatValue()

QString Isis::PvlFormat::formatValue ( const PvlKeyword keyword,
int  valueIndex = 0 
)
virtual

◆ isSingleUnit()

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
keywordThe PvlKeyword to be formatted

References Isis::PvlKeyword::size(), Isis::PvlKeyword::stringEqual(), and Isis::PvlKeyword::unit().

◆ setCharLimit()

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
limitThe new character limit.

References m_charLimit.

◆ type()

KeywordType Isis::PvlFormat::type ( const PvlKeyword keyword)
virtual

Member Data Documentation

◆ m_charLimit

unsigned int Isis::PvlFormat::m_charLimit
protected

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

Referenced by charLimit(), and setCharLimit().

◆ m_keywordMap

Pvl Isis::PvlFormat::m_keywordMap
protected

◆ m_keywordMapFile

QString Isis::PvlFormat::m_keywordMapFile
protected

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