#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) | |
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 |
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.
A hash map containing the JCAMP entries.
A hash map containing the header entries.
typedef std::pair<String, JCAMPValue> BALL::JCAMPFile::KeyValuePair |
a key-value pair
BALL::JCAMPFile::JCAMPFile | ( | ) | [inline] |
BALL::JCAMPFile::JCAMPFile | ( | const String & | name, | |
OpenMode | open_mode = std::ios::in | |||
) | throw (Exception::FileNotFound) |
BALL::JCAMPFile::JCAMPFile | ( | const JCAMPFile & | file | ) | throw (Exception::FileNotFound) |
Copy constructor.
virtual BALL::JCAMPFile::~JCAMPFile | ( | ) | [inline, virtual] |
Destructor.
double BALL::JCAMPFile::getDoubleValue | ( | const String & | name | ) | const throw (Exception::InvalidFormat) |
const EntryMap& BALL::JCAMPFile::getEntries | ( | ) | const [inline] |
EntryMap& BALL::JCAMPFile::getEntries | ( | ) | [inline] |
const HeaderMap& BALL::JCAMPFile::getHeader | ( | ) | const [inline] |
HeaderMap& BALL::JCAMPFile::getHeader | ( | ) | [inline] |
Index BALL::JCAMPFile::getIntValue | ( | const String & | name | ) | const throw (Exception::InvalidFormat) |
const JCAMPValue& BALL::JCAMPFile::operator[] | ( | const String & | name | ) | const [inline] |
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.
HeaderMap BALL::JCAMPFile::header_ [protected] |
Entries from the header section.