30 XMLWriter (
string path) {fic.open(path.c_str()) ;
if (!fic) printf(
"ERR: cannot open %s in writing \n", path.c_str()) ; }
31 void header (
int dimension,
string input) ;
32 void writeTs (
double ts, tuple<
string,vector<vector<double>>*,
ArrayType>
a);
33 void startTS (
double ts) ;
39 void emergencyclose() ;
41 void openbranch (
string name, vector < pair<string,string>> attributes) ;
42 void openbranch (
string name) {
return openbranch(name, {}) ; }
43 template <
class T>
void smallbranch (
string name, T value) ;
44 template <
class T>
void smallbranch (
string name, vector < pair<string,string>> attributes, T value) ;
51 vector <pair<double,streampos>>
index ;
52 int encodebase64f (ostream &out, vector<double>& val) ;
53 void encodebase64f_end (ostream &out) {
static char lst[]=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" ;
if (state!=0) out <<lst[remainer] ; remainer=state=0 ; }
54 unsigned char state=0, remainer=0 ;
58 string quote (
string a) {
return "'"+
a+
"'" ; }
67 std::pair<string, map<string,string>> gettag() ;
68 tuple <string, map<string,string> , std::vector<double> > gettagdata() ;
76 XMLReader(
string path):
XMLReader_base(path) {tags=gettag() ;
if (tags.first!=
"demnd") printf(
"ERR:unexpected first entry (should be demnd)\n") ;
77 cout <<
"File date: "<< tags.second[
"date"]<<
"\nInput file: " << tags.second[
"input"] <<
"\nDimensions: "<< tags.second[
"dimensions"] <<
"\n" ;
79 int read_boundaries (vector <vector <double>> &boundaries) ;
80 int read_radius (vector <double> &
radius) ;
81 double read_nextts(vector<string> &names, vector<vector<vector<double>>> & data) ;
82 std::vector<std::pair<double,std::streampos>> read_index () ;
83 int decodebase64f (istream &in, vector<float>& val) ;
84 int decodebase64f_2dd (istream &in, vector<vector<double>>& val) ;
86 std::pair<string, map<string,string>>
tags ;
@ particles
Definition: Parameters.h:8
@ contacts
Definition: Parameters.h:8
EncodingType
Definition: Xml.h:26
ArrayType
Definition: Xml.h:25
ifstream fic
Definition: Xml.h:66
stack< string > tree
Definition: Xml.h:65
void close()
Definition: Xml.h:70
std::pair< string, map< string, string > > tags
Definition: Xml.h:86
XMLReader(string path)
Definition: Xml.h:76
void encodebase64f_end(ostream &out)
Definition: Xml.h:53
string quote(string a)
Definition: Xml.h:58
void writeArray(string name, std::vector< std::vector< double > > *x, ArrayType t, EncodingType te=EncodingType::ascii)
XMLWriter(string path)
Definition: Xml.h:30
vector< pair< double, streampos > > index
Definition: Xml.h:51
void openbranch(string name)
Definition: Xml.h:42
stack< string > hierarchy
Definition: Xml.h:56
void writeArray(string name, std::vector< double > *x, ArrayType t, EncodingType te=EncodingType::ascii)
ofstream fic
Definition: Xml.h:47
@ radius
Definition: Typedefs.h:19
Definition: json.hpp:5678
void close(FILE *out)
Definition: Vtk.h:123
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181