#include <JCAMPFile.h>
Public Types |
|
enum | ContentType { STRING, NUMERIC, ARRAY } |
Type definitions. |
|
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) | |
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. |
|
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 |
Equality operator. |
|
bool | operator!= (const JCAMPFile &f) const |
Inequality operator. |
|
Protected Attributes |
|
HeaderMap | header_ |
Entries from the header
section. |
|
EntryMap | entries_ |
Entries from the key-value
section. |
This class parses JCAMP files, which are often used to store parameter files in spectroscopy (NMR, IR, MS), e.g. in Bruker instruments.