BALL::JCAMPFile Class Reference
[NMR File Formats]

#include <BALL/FORMAT/JCAMPFile.h>

Inheritance diagram for BALL::JCAMPFile:
Inheritance graph
[legend]

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

Definition at line 28 of file JCAMPFile.h.


Member Typedef Documentation

A hash map containing the JCAMP entries.

Definition at line 69 of file JCAMPFile.h.

A hash map containing the header entries.

Definition at line 72 of file JCAMPFile.h.

a key-value pair

Definition at line 66 of file JCAMPFile.h.


Member Enumeration Documentation

Type definitions

Enumerator:
STRING 
NUMERIC 
ARRAY 

Definition at line 37 of file JCAMPFile.h.


Constructor & Destructor Documentation

BALL::JCAMPFile::JCAMPFile (  )  [inline]

Definition at line 80 of file JCAMPFile.h.

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

Destructor.

Definition at line 87 of file JCAMPFile.h.


Member Function Documentation

double BALL::JCAMPFile::getDoubleValue ( const String name  )  const throw (Exception::InvalidFormat)
const EntryMap& BALL::JCAMPFile::getEntries (  )  const [inline]

Definition at line 112 of file JCAMPFile.h.

EntryMap& BALL::JCAMPFile::getEntries (  )  [inline]

Definition at line 109 of file JCAMPFile.h.

const HeaderMap& BALL::JCAMPFile::getHeader (  )  const [inline]

Definition at line 106 of file JCAMPFile.h.

HeaderMap& BALL::JCAMPFile::getHeader (  )  [inline]

Definition at line 103 of file JCAMPFile.h.

Index BALL::JCAMPFile::getIntValue ( const String name  )  const throw (Exception::InvalidFormat)
bool BALL::JCAMPFile::hasEntry ( const String name  )  const [inline]

Definition at line 126 of file JCAMPFile.h.

bool BALL::JCAMPFile::hasHeader ( const String name  )  const [inline]

Definition at line 129 of file JCAMPFile.h.

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]

Definition at line 115 of file JCAMPFile.h.

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.

Definition at line 155 of file JCAMPFile.h.

Entries from the header section.

Definition at line 152 of file JCAMPFile.h.

Generated by  doxygen 1.6.3