5 #ifndef realroot_xml_hpp_
6 #define realroot_xml_hpp_
17 template<
class ISTREAM>
18 bool skip(ISTREAM& is,
const char* s)
20 char c=(*s);
const char* t=s;
21 unsigned n= strlen(s),i=0;
24 for(i=0; i<n && (c !=EOF) && (c=is.get()) == (*t); i++,t++);
33 template<
class OSTREAM,
typename X>
34 OSTREAM&
print(OSTREAM& os,
const X& x,
const char *tag)
36 os<<
"<"<<tag<<
">"<<x<<
"</"<<tag<<
">";
41 #define begin_polynomial "<polynomial>"
42 #define end_polynomial "</polynomial>"
46 template<
class ISTREAM>
47 std::string
read_tag(ISTREAM& is,
const char* tag)
51 std::string s;
char c;
52 while((c=is.get()) != EOF && c !=
'<')
61 return std::string(
"");
65 template<
class ISTREAM,
typename T>
70 ::std::string s;
char c;
71 while((c=is.get()) != EOF && c !=
'<')
73 if(c !=
' ' && c !=
'\n') s+=
c;
87 template<
class ISTREAM,
typename T,
class VAR>
92 std::string s;
char c;
93 while((c=is.get()) != EOF && c !=
'<')
95 if(c !=
' ' && c !=
'\n') s+=
c;
103 p=T(0);
return false;
109 template<
typename C,
typename R>
struct upoldse;
116 template<
class ISTREAM,
typename T>
121 std::string s;
char c;
122 while((c=is.get()) != EOF && c !=
'<')
124 if(c !=
' ' && c !=
'\n') s+=
c;
132 p=T(0);
return false;
137 template<
class ISTREAM,
typename C,
typename R>
144 template<
class OSTREAM,
typename C,
typename R>
155 #endif //realroot_xml_hpp_
bool read(ISTREAM &is, polynomial< C, R > &p, variables &V)
Read a polynomial, enclosed in polynomial tags.
Definition: polynomial_xml.hpp:41
TMPL X
Definition: polynomial_operators.hpp:148
#define begin_polynomial
Definition: xml.hpp:41
bool skip(ISTREAM &is, const char *s)
Definition: polynomial_xml.hpp:23
bool read_upol(ISTREAM &is, T &p)
Read a polynomial, enclosed in polynomial tags.
Definition: xml.hpp:117
OSTREAM & print(OSTREAM &os, const X &x, const char *tag)
Definition: polynomial_xml.hpp:16
std::string read_tag(ISTREAM &is, const char *tag)
Read between tag and "<" and build p from this string;.
Definition: xml.hpp:47
const C & c
Definition: Interval_glue.hpp:45
bool read_pol(ISTREAM &is, T &p)
Read a polynomial, enclosed in polynomial tags.
Definition: xml.hpp:66