Isis 3 Programmer Reference
Isis::PvlFormatPds Class Reference

Formats the value of a PvlKeyword into a PDS complient string. More...

#include <PvlFormatPds.h>

Inheritance diagram for Isis::PvlFormatPds:
Inheritance graph
Collaboration diagram for Isis::PvlFormatPds:
Collaboration graph

Public Member Functions

 PvlFormatPds (const QString &file)
 
 PvlFormatPds (Pvl &keymap)
 
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 ()
 
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 KeywordType type (const PvlKeyword &keyword)
 
virtual int accuracy (const PvlKeyword &keyword)
 

Protected Member Functions

virtual QString addQuotes (const QString value)
 
QString formatString (const PvlKeyword &keyword, int num)
 
QString formatInteger (const PvlKeyword &keyword, int num, int bytes)
 
QString formatReal (const PvlKeyword &keyword, int num, int precision)
 
QString formatEnum (const PvlKeyword &keyword, int num)
 
QString formatBinary (const PvlKeyword &keyword, int num, int bytes)
 
QString formatHex (const PvlKeyword &keyword, int num, int bytes)
 
QString formatBool (const PvlKeyword &keyword, int num)
 
QString 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

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

Private Member Functions

void init ()
 Clears all PvlFormatPds specific data.
 

Detailed Description

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.

Author
2006-09-05 Stuart Sides
History

2006-09-05 Stuart Sides - Original version

2006-12-14 Stuart Sides - Took out the upcaseing of units

2008-09-19 Kris Becker - Put quotes around "N/A", "NULL", "UNK"; ensure units are placed after each element in array instead of one at the end and outside the closing right parenthesis. These changes bring us more in line with PDS compliancy.

2008-09-30 Christopher Austin - added FormatEOL()

2009-09-15 Jeannie Walldren - Fixed bug where code was adding 2 sets of quotes to N/A when formatting value. These changes were made in AddQuotes(), FormatString() and FormatUnknown() methods.

2013-03-11 Steven Lambright and Mathew Eis - Brought method names and member variable names up to the current Isis 3 coding standards. Fixes #1533.

Definition at line 45 of file PvlFormatPds.h.

Constructor & Destructor Documentation

◆ PvlFormatPds() [1/3]

Isis::PvlFormatPds::PvlFormatPds ( )

Definition at line 28 of file PvlFormatPds.cpp.

◆ PvlFormatPds() [2/3]

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

Definition at line 40 of file PvlFormatPds.cpp.

◆ PvlFormatPds() [3/3]

Isis::PvlFormatPds::PvlFormatPds ( Pvl & keymap)

Definition at line 52 of file PvlFormatPds.cpp.

◆ ~PvlFormatPds()

virtual Isis::PvlFormatPds::~PvlFormatPds ( )
inlinevirtual

Definition at line 52 of file PvlFormatPds.h.

Member Function Documentation

◆ accuracy()

int Isis::PvlFormat::accuracy ( const PvlKeyword & keyword)
virtualinherited

Definition at line 129 of file PvlFormat.cpp.

◆ add() [1/2]

void Isis::PvlFormat::add ( const QString & file)
inherited

Definition at line 68 of file PvlFormat.cpp.

◆ add() [2/2]

void Isis::PvlFormat::add ( Pvl & keymap)
inherited

Definition at line 90 of file PvlFormat.cpp.

◆ addQuotes()

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

Reimplemented from Isis::PvlFormat.

Definition at line 661 of file PvlFormatPds.cpp.

◆ charLimit()

unsigned int Isis::PvlFormat::charLimit ( ) const
inlineinherited

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.

Definition at line 138 of file PvlFormat.h.

References Isis::PvlFormat::m_charLimit.

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

◆ formatBinary()

QString Isis::PvlFormatPds::formatBinary ( const PvlKeyword & keyword,
int num,
int bytes )
protected

Definition at line 439 of file PvlFormatPds.cpp.

◆ formatBool()

QString Isis::PvlFormatPds::formatBool ( const PvlKeyword & keyword,
int num )
protected

Definition at line 583 of file PvlFormatPds.cpp.

◆ formatEnd()

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

Reimplemented from Isis::PvlFormat.

Definition at line 641 of file PvlFormatPds.cpp.

◆ formatEnum()

QString Isis::PvlFormatPds::formatEnum ( const PvlKeyword & keyword,
int num )
protected

Definition at line 255 of file PvlFormatPds.cpp.

◆ formatEOL()

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

Reimplemented from Isis::PvlFormat.

Definition at line 59 of file PvlFormatPds.h.

◆ formatHex()

QString Isis::PvlFormatPds::formatHex ( const PvlKeyword & keyword,
int num,
int bytes )
protected

Definition at line 512 of file PvlFormatPds.cpp.

◆ formatInteger()

QString Isis::PvlFormatPds::formatInteger ( const PvlKeyword & keyword,
int num,
int bytes )
protected

Definition at line 380 of file PvlFormatPds.cpp.

◆ formatName()

QString Isis::PvlFormatPds::formatName ( const PvlKeyword & keyword)
virtual

Reimplemented from Isis::PvlFormat.

Definition at line 628 of file PvlFormatPds.cpp.

◆ formatReal()

QString Isis::PvlFormatPds::formatReal ( const PvlKeyword & keyword,
int num,
int precision )
protected

Definition at line 190 of file PvlFormatPds.cpp.

◆ formatString()

QString Isis::PvlFormatPds::formatString ( const PvlKeyword & keyword,
int num )
protected

Definition at line 128 of file PvlFormatPds.cpp.

◆ formatUnknown()

QString Isis::PvlFormatPds::formatUnknown ( const PvlKeyword & keyword,
int num )
protected

Definition at line 319 of file PvlFormatPds.cpp.

◆ formatValue()

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

Reimplemented from Isis::PvlFormat.

Definition at line 68 of file PvlFormatPds.cpp.

◆ init()

void Isis::PvlFormatPds::init ( )
private

Clears all PvlFormatPds specific data.

Definition at line 58 of file PvlFormatPds.cpp.

◆ isSingleUnit()

bool Isis::PvlFormat::isSingleUnit ( const PvlKeyword & keyword)
protectedinherited

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

Parameters
keywordThe PvlKeyword to be formatted

Definition at line 307 of file PvlFormat.cpp.

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

◆ setCharLimit()

void Isis::PvlFormat::setCharLimit ( const unsigned int limit)
inlineinherited

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.

Definition at line 127 of file PvlFormat.h.

References Isis::PvlFormat::m_charLimit.

◆ type()

KeywordType Isis::PvlFormat::type ( const PvlKeyword & keyword)
virtualinherited

Definition at line 111 of file PvlFormat.cpp.

Member Data Documentation

◆ m_charLimit

unsigned int Isis::PvlFormat::m_charLimit
protectedinherited

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

Definition at line 163 of file PvlFormat.h.

Referenced by Isis::PvlFormat::charLimit(), Isis::PvlFormat::init(), and Isis::PvlFormat::setCharLimit().

◆ m_keywordMap

Pvl Isis::PvlFormat::m_keywordMap
protectedinherited

Definition at line 160 of file PvlFormat.h.

◆ m_keywordMapFile

QString Isis::PvlFormat::m_keywordMapFile
protectedinherited

Definition at line 159 of file PvlFormat.h.


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