/*************************************************************************************
* *
* ***** OpenThermo ***** *
* Calculation of thermodynamic functions from molecular data *
* Copyright 2008 Konstantin Tokarev <annulen@users.sourceforge.net> *
* and others *
* *
*************************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License. See COPYING for *
* more details *
* *
*************************************************************************************
* Module name : atom.hpp *
* Author : Tokarev. K *
* Last modification : 2008/08/05 *
* Description : This module contains declarations of class 'XMLInputDocument', *
* which is used for structured storage of input data, and *
* useful functions to work with XMLNodes *
* *
*************************************************************************************/
#ifndef XML_HPP
#define XML_HPP
#include "xmlpp/xmlpp.h"
using namespace xmlpp;
// Useful functions to work with XML
string GetCdata (XMLNode * node);
int CountNodes (XMLNode * node, string name);
// Class of input file
class XMLInputFile : public XMLDocument
{
friend class xmlparser;
public:
//! ctor
explicit XMLInputFile();
//! ctor, takes xml context pointer
explicit XMLInputFile(XMLContextPtr pctx);
//! dtor
~XMLInputFile();
//! load xml node from file, sets filename for this XMLDocument
void load_file(string filename="");
// Properties
bool is_valid();
bool has_units_inp();
bool has_units_out();
bool has_control();
bool has_thresh();
bool has_job();
bool has_electronic_levels();
bool has_rotors();
bool has_freq_anh();
bool has_freq_exp();
private:
// Selfcheck
void Validate();
// Correctness
bool isValid;
// Content flags
bool hasUnits;
bool hasUnitsInp;
bool hasUnitsOut;
bool hasControl;
bool hasThresh;
bool hasJob;
bool hasElectronicLevels;
bool hasRotors;
bool hasFreqHarm;
bool hasFreqAnh;
bool hasFreqExp;
};
#endif /* XML_HPP */