[go: up one dir, main page]

Menu

[r90]: / openthermo / xml.hpp  Maximize  Restore  History

Download this file

93 lines (79 with data), 3.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*************************************************************************************
* *
* ***** 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);
bool XML_True (string s);
void XML_ShowError (xmlerror e, XMLContextPtr ctx, string FileName);
// 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;
};
/*
class XMLOutputFile : public XMLDocument
{
public:
void SetValue(double p, double T, string func_name, string contrib_type="total");*/
#endif /* XML_HPP */