#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) | |
virtual | ~JCAMPFile () |
Accessors | |
void | read () |
bool | write () |
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 |
Index | getIntValue (const String &name) const |
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] |
Default constructor
Definition at line 81 of file JCAMPFile.h.
Detailed constructor
Exception::FileNotFound | if the file could not be opened |
virtual BALL::JCAMPFile::~JCAMPFile | ( | ) | [inline, virtual] |
Destructor
Definition at line 90 of file JCAMPFile.h.
Return a double value for key name
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.
Return an int value for key name
Exception::InvalidFormat | if the value is not convertible to an int |
Definition at line 133 of file JCAMPFile.h.
Definition at line 136 of file JCAMPFile.h.
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.
Exception::ParseError | if a syntax error was encountered |
bool BALL::JCAMPFile::write | ( | ) |
Write the file.
File::CannotWrite | if writing to the file failed |
EntryMap BALL::JCAMPFile::entries_ [protected] |
Entries from the key-value section.
Definition at line 162 of file JCAMPFile.h.
HeaderMap BALL::JCAMPFile::header_ [protected] |
Entries from the header section.
Definition at line 159 of file JCAMPFile.h.