Update of /cvsroot/pure-data/externals/grill/pool/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11080/source
Modified Files: pool.cpp Log Message: added saving/loading of spaces and other special characters (escaping) more symbol escaping
Index: pool.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/pool/source/pool.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pool.cpp 25 Mar 2005 04:53:43 -0000 1.14 --- pool.cpp 19 Apr 2005 13:08:32 -0000 1.15 *************** *** 476,480 **** char tmp[1024]; char *m = tmp; // write position ! // go to next whitespace for(bool escaped = false;; ++c) --- 476,488 ---- char tmp[1024]; char *m = tmp; // write position ! ! bool issymbol; ! if(*c == '"') { ! issymbol = true; ! ++c; ! } ! else ! issymbol = false; ! // go to next whitespace for(bool escaped = false;; ++c) *************** *** 487,493 **** escaped = true; } else if(!*c || (isspace(*c) && !escaped)) { ! *m = 0; ! break; } else { --- 495,508 ---- escaped = true; } + else if(*c == '"' && issymbol && !escaped) { + // end of string + ++c; + FLEXT_ASSERT(!*c || isspace(*c)); + *m = 0; + break; + } else if(!*c || (isspace(*c) && !escaped)) { ! *m = 0; ! break; } else { *************** *** 500,504 **** float fres; // first try float ! if(sscanf(tmp,"%f",&fres) == 1) { if(a) { int ires = (int)fres; // try a cast --- 515,519 ---- float fres; // first try float ! if(!issymbol && sscanf(tmp,"%f",&fres) == 1) { if(a) { int ires = (int)fres; // try a cast *************** *** 558,561 **** --- 573,577 ---- case A_SYMBOL: { const char *c = flext::GetString(flext::GetSymbol(a)); + os << '"'; for(; *c; ++c) { if(isspace(*c) || *c == '\' || *c == ',') *************** *** 563,566 **** --- 579,583 ---- os << *c; } + os << '"'; break; }