shape_doc 0.1
mmx::xml Namespace Reference

Functions


Function Documentation

bool mmx::xml::read ( ISTREAM &  is,
STRING &  s,
const char *  mark 
)

Read a univariate polynomial, enclosed in polynomial tags.

Definition at line 30 of file xml.hpp.

References skip().

                                                   {
      if(skip(is,mark)) {
        char c;
        while((c=is.get()) != EOF && c != '<') {
          s+=c;
        }
        s+='\0';
        return true;
      } else {
        return false;
      }
    }
bool mmx::xml::skip ( ISTREAM &  is,
const char *  s 
)

Definition at line 12 of file xml.hpp.

Referenced by read().

                                          {
      char c=(*s); const char* t=s;
      unsigned n= strlen(s),i=0;
      while(c != EOF) {
        for(i=0; i<n && (c !=EOF) && (c=is.get()) == (*t); i++,t++);
        if(i==n) {
          while((c=is.get()) != EOF && c != '>') ;
          return true;
        }
      else
        t=s;
      }

      return false;
    }