#include #include // ********************************************************************** // * * // * * // * * // ********************************************************************** void textprofilet::clear() { data_elements=0; } bool textprofilet::readline(std::istream &in) { char line[10000], ch; if(!in.get(line, 10000-1)) return TRUE; in.get(ch); // read newline char *tptr, *tptr2; clear(); tptr=strchr(line, '\r'); if(tptr!=NULL) *tptr=0; tptr=strchr(line, '\n'); if(tptr!=NULL) *tptr=0; if(line[0]==0 || line[0]=='#' || line[0]==';') return TRUE; tptr=line; while(*tptr!=0) { for(tptr2=tptr; *tptr2!=0 && *tptr2!='=' && *tptr2!=':'; tptr2++); if(*tptr2==0) break; *(tptr2++)=0; const char *id=tptr; for(tptr=tptr2; *tptr2!=0 && *tptr2!=';'; tptr2++); *(tptr2++)=0; do_set(id, tptr); tptr=tptr2; } return FALSE; } bool textprofilet::writeline(std::ostream &out) { bool first=TRUE; for(unsigned i=0; i