1 #ifndef realroot_polynomial_xml_hpp
2 #define realroot_polynomial_xml_hpp
8 #define begin_polynomial "<polynomial"
9 #define end_polynomial "</polynomial>"
15 template<
class OSTREAM,
typename X>
16 OSTREAM&
print(OSTREAM& os,
const X& x,
const char *tag)
18 os<<
"<"<<tag<<
">"<<x<<
"</"<<tag<<
">";
22 template<
class ISTREAM>
23 bool skip(ISTREAM& is,
const char* s) {
24 char c=(*s);
const char* t=s;
25 unsigned n= strlen(s),i=0;
27 for(i=0; i<n && (c !=EOF) && (c=is.get()) == (*t); i++,t++);
29 while((c=is.get()) != EOF && c !=
'>') ;
40 template<
class ISTREAM,
typename C,
typename R>
bool
43 std::string s;
char c;
44 while((c=is.get()) != EOF && c !=
'<') {
45 if(c !=
' ' && c !=
'\n') s+=
c;
56 template<
class ISTREAM>
bool
57 sread(ISTREAM& is, std::string& s) {
60 while((c=is.get()) != EOF && c !=
'<') {
61 if(c !=
' ' && c !=
'\n') s+=
c;
73 # undef begin_polynomial
74 # undef end_polynomial
75 #endif //realroot_polynomial_xml_hpp
#define begin_polynomial
Definition: polynomial_xml.hpp:8
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
bool sread(ISTREAM &is, std::string &s)
Read a polynomial as a string, enclosed in polynomial tags.
Definition: polynomial_xml.hpp:57
bool skip(ISTREAM &is, const char *s)
Definition: polynomial_xml.hpp:23
OSTREAM & print(OSTREAM &os, const X &x, const char *tag)
Definition: polynomial_xml.hpp:16
Definition: polynomial.hpp:37
const C & c
Definition: Interval_glue.hpp:45
Definition: variables.hpp:65