BALL::JCAMPFile Class Reference
[NMR File Formats]

#include <BALL/FORMAT/JCAMPFile.h>

Inheritance diagram for BALL::JCAMPFile:
BALL::LineBasedFile BALL::File

List of all members.


Classes

class  JCAMPValue

Public Types

enum  ContentType { STRING, NUMERIC, ARRAY }
typedef std::pair< String,
JCAMPValue
KeyValuePair
 

a key-value pair


typedef StringHashMap< JCAMPValueEntryMap
 

A hash map containing the JCAMP entries.


typedef StringHashMap< StringHeaderMap
 

A hash map containing the header entries.



Public Member Functions

Constructors and Destructors
 JCAMPFile ()
 JCAMPFile (const String &name, OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound)
 JCAMPFile (const JCAMPFile &file) throw (Exception::FileNotFound)
 

Copy constructor.


virtual ~JCAMPFile ()
 

Destructor.


Accessors
void read () throw (Exception::ParseError)
 

Read the file.


bool write () throw (File::CannotWrite)
 

Write the file.


HeaderMapgetHeader ()
const HeaderMapgetHeader () const
EntryMapgetEntries ()
const EntryMapgetEntries () const
const JCAMPValueoperator[] (const String &name) const
double getDoubleValue (const String &name) const throw (Exception::InvalidFormat)
Index getIntValue (const String &name) const throw (Exception::InvalidFormat)
bool hasEntry (const String &name) const
bool hasHeader (const String &name) const
const JCAMPFileoperator= (const JCAMPFile &file)
Equality operators
bool operator== (const JCAMPFile &f) const
bool operator!= (const JCAMPFile &f) const

Protected Attributes

HeaderMap header_
 

Entries from the header section.


EntryMap entries_
 

Entries from the key-value section.



Detailed Description

JCAMP file class. This class parses JCAMP files, which are often used to store parameter files in spectroscopy (NMR, IR, MS), e.g. in Bruker instruments.

This class has rudimentary support for the format only. The most severe drawback currently is the lack of support for writing JCAMP files.

Member Typedef Documentation

A hash map containing the JCAMP entries.

A hash map containing the header entries.

a key-value pair


Member Enumeration Documentation

Type definitions

Enumerator:
STRING 
NUMERIC 
ARRAY 

Constructor & Destructor Documentation

BALL::JCAMPFile::JCAMPFile (  )  [inline]
BALL::JCAMPFile::JCAMPFile ( const String name,
OpenMode  open_mode = std::ios::in 
) throw (Exception::FileNotFound)
BALL::JCAMPFile::JCAMPFile ( const JCAMPFile file  )  throw (Exception::FileNotFound)

Copy constructor.

virtual BALL::JCAMPFile::~JCAMPFile (  )  [inline, virtual]

Destructor.


Member Function Documentation

double BALL::JCAMPFile::getDoubleValue ( const String name  )  const throw (Exception::InvalidFormat)
const EntryMap& BALL::JCAMPFile::getEntries (  )  const [inline]
EntryMap& BALL::JCAMPFile::getEntries (  )  [inline]
const HeaderMap& BALL::JCAMPFile::getHeader (  )  const [inline]
HeaderMap& BALL::JCAMPFile::getHeader (  )  [inline]
Index BALL::JCAMPFile::getIntValue ( const String name  )  const throw (Exception::InvalidFormat)
bool BALL::JCAMPFile::hasEntry ( const String name  )  const [inline]
bool BALL::JCAMPFile::hasHeader ( const String name  )  const [inline]
bool BALL::JCAMPFile::operator!= ( const JCAMPFile f  )  const

Inequality operator

const JCAMPFile& BALL::JCAMPFile::operator= ( const JCAMPFile file  ) 
bool BALL::JCAMPFile::operator== ( const JCAMPFile f  )  const

Equality operator

const JCAMPValue& BALL::JCAMPFile::operator[] ( const String name  )  const [inline]
void BALL::JCAMPFile::read (  )  throw (Exception::ParseError)

Read the file.

bool BALL::JCAMPFile::write (  )  throw (File::CannotWrite)

Write the file.


Member Data Documentation

Entries from the key-value section.

Entries from the header section.