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)
virtual ~JCAMPFile ()
Accessors

void read ()
bool write ()
HeaderMapgetHeader ()
const HeaderMapgetHeader () const
EntryMapgetEntries ()
const EntryMapgetEntries () const
const JCAMPValueoperator[] (const String &name) const
double getDoubleValue (const String &name) const
Index getIntValue (const String &name) const
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]

Default constructor

Definition at line 81 of file JCAMPFile.h.

BALL::JCAMPFile::JCAMPFile ( const String name,
OpenMode  open_mode = std::ios::in 
)

Detailed constructor

Exceptions:
Exception::FileNotFound if the file could not be opened
virtual BALL::JCAMPFile::~JCAMPFile (  )  [inline, virtual]

Destructor

Definition at line 90 of file JCAMPFile.h.


Member Function Documentation

double BALL::JCAMPFile::getDoubleValue ( const String name  )  const

Return a double value for key name

Exceptions:
Exception::InvalidFormat if the value is not a floating point number
const EntryMap& BALL::JCAMPFile::getEntries (  )  const [inline]

Definition at line 117 of file JCAMPFile.h.

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

Definition at line 114 of file JCAMPFile.h.

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

Definition at line 111 of file JCAMPFile.h.

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

Definition at line 108 of file JCAMPFile.h.

Index BALL::JCAMPFile::getIntValue ( const String name  )  const

Return an int value for key name

Exceptions:
Exception::InvalidFormat if the value is not convertible to an int
bool BALL::JCAMPFile::hasEntry ( const String name  )  const [inline]

Definition at line 133 of file JCAMPFile.h.

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

Definition at line 136 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 120 of file JCAMPFile.h.

void BALL::JCAMPFile::read (  ) 

Read the file.

Exceptions:
Exception::ParseError if a syntax error was encountered
bool BALL::JCAMPFile::write (  ) 

Write the file.

Exceptions:
File::CannotWrite if writing to the file failed

Member Data Documentation

Entries from the key-value section.

Definition at line 162 of file JCAMPFile.h.

Entries from the header section.

Definition at line 159 of file JCAMPFile.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Generated by  doxygen 1.6.3