Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

JCAMPFile Class Reference
[NMR File Formats]

JCAMP file class. More...

#include <JCAMPFile.h>

Inheritance diagram for JCAMPFile:

LineBasedFile File List of all members.

Public Types

typedef std::pair< String,
JCAMPValue > 
KeyValuePair
 a key-value pair
typedef StringHashMap< JCAMPValue > EntryMap
 A hash map containing the JCAMP entries.
typedef StringHashMap< StringHeaderMap
 A hash map containing the header entries.
enum  ContentType { STRING, NUMERIC, ARRAY }

Public Member Functions

Constructors and Destructors
 JCAMPFile (const String &name, OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound)
 JCAMPFile (const JCAMPFile &file) throw (Exception::FileNotFound)
 Copy constructor.
virtual ~JCAMPFile () throw ()
 Destructor.
Accessors
void read () throw (Exception::ParseError)
 Read the file.
bool write () throw (File::CannotWrite)
 Write the file.
HeaderMapgetHeader () throw ()
const HeaderMapgetHeader () const throw ()
EntryMapgetEntries () throw ()
const EntryMapgetEntries () const throw ()
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 throw ()
bool hasHeader (const String &name) const throw ()
const JCAMPFileoperator= (const JCAMPFile &file) throw ()
Equality operators
bool operator== (const JCAMPFile &f) const throw ()
 Equality operator.
bool operator!= (const JCAMPFile &f) const throw ()
 Inequality operator.

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.