#include <BALL/FORMAT/JCAMPFile.h>
Classes | |
class | JCAMPValue |
Public Types | |
enum | ContentType { STRING, NUMERIC, ARRAY } |
typedef std::pair< String, JCAMPValue > | KeyValuePair |
a key-value pair | |
typedef StringHashMap< JCAMPValue > | EntryMap |
A hash map containing the JCAMP entries. | |
typedef StringHashMap< String > | HeaderMap |
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. | |
HeaderMap & | getHeader () |
const HeaderMap & | getHeader () const |
EntryMap & | getEntries () |
const EntryMap & | getEntries () const |
const JCAMPValue & | operator[] (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 JCAMPFile & | operator= (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. |
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.
Definition at line 28 of file JCAMPFile.h.
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.
typedef std::pair<String, JCAMPValue> BALL::JCAMPFile::KeyValuePair |
a key-value pair
Definition at line 66 of file JCAMPFile.h.
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.
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) |
Definition at line 126 of file JCAMPFile.h.
Definition at line 129 of file JCAMPFile.h.
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.
EntryMap BALL::JCAMPFile::entries_ [protected] |
Entries from the key-value section.
Definition at line 155 of file JCAMPFile.h.
HeaderMap BALL::JCAMPFile::header_ [protected] |
Entries from the header section.
Definition at line 152 of file JCAMPFile.h.