00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020
00022
00032 #ifndef xml_io_private_h
00033 #define xml_io_private_h
00034
00035 #include "xml_io.h"
00036 #include <stdexcept>
00037 #include <cfloat>
00038 #include "matpackVII.h"
00039 #include "array.h"
00040 #include "messages.h"
00041 #include "ppath.h"
00042 #include "agenda_class.h"
00043 #include "absorption.h"
00044 #include "gas_abs_lookup.h"
00045 #include "optproperties.h"
00046 #include "bifstream.h"
00047 #include "bofstream.h"
00048
00049
00051
00053
00054 void
00055 xml_open_output_file (ostream& file, const String& name);
00056
00057 void
00058 xml_open_input_file (ifstream& file, const String& name);
00059
00060
00062
00064
00066
00070 class XMLAttribute
00071 {
00072 public:
00073 String name;
00074 String value;
00075 };
00076
00077
00079
00082 class ArtsXMLTag
00083 {
00084 public:
00085
00086 String&
00087 get_name () { return (name); }
00088
00089 void
00090 check_name (const String& expected_name);
00091
00092 void
00093 set_name (const String& new_name) { name = new_name; }
00094
00095 void
00096 add_attribute (const String& aname, const String& value);
00097
00098 void
00099 add_attribute (const String& aname, const Index& value);
00100
00101 void
00102 check_attribute (const String& aname, const String& value);
00103
00104 void
00105 get_attribute_value (const String& aname, String& value);
00106
00107 void
00108 get_attribute_value (const String& aname, Index& value);
00109
00110 void
00111 read_from_stream (istream& is);
00112
00113 void
00114 write_to_stream (ostream& os);
00115
00116 private:
00117 String name;
00118 Array<XMLAttribute> attribs;
00119 };
00120
00121
00123
00125
00126 void
00127 xml_parse_error (const String& str_error);
00128
00129 void
00130 xml_data_parse_error (ArtsXMLTag& tag, String str_error);
00131
00132 void
00133 xml_read_header_from_stream (istream& is, FileType& ftype,
00134 NumericType& ntype, EndianType& etype);
00135
00136 void
00137 xml_read_footer_from_stream (istream& is);
00138
00139 void
00140 xml_write_header_to_stream (ostream& os, FileType ftype);
00141
00142 void
00143 xml_write_footer_to_stream (ostream& os);
00144
00145 void
00146 xml_set_stream_precision (ostream& os);
00147
00148
00149 #endif