From 810a63a522ec5c3f05df5b2bc1cf35306bf4accb Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 3 Aug 2003 02:36:46 +0000 Subject: "" svn path=/trunk/; revision=819 --- externals/grill/flext/source/flatom_pr.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'externals/grill/flext/source/flatom_pr.cpp') diff --git a/externals/grill/flext/source/flatom_pr.cpp b/externals/grill/flext/source/flatom_pr.cpp index 639bca63..e700df8a 100644 --- a/externals/grill/flext/source/flatom_pr.cpp +++ b/externals/grill/flext/source/flatom_pr.cpp @@ -19,7 +19,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include // \TODO take bufsz into account! -void flext::PrintAtom(const t_atom &a,char *buf,int bufsz) +bool flext::PrintAtom(const t_atom &a,char *buf,int bufsz) { if(IsFloat(a)) { sprintf(buf,"%g",GetFloat(a)); @@ -35,8 +35,25 @@ void flext::PrintAtom(const t_atom &a,char *buf,int bufsz) } else ERRINTERNAL(); + return true; } +bool flext::AtomList::Print(char *buffer,int buflen) const +{ + bool ok = true; + for(int i = 0; ok && i < Count(); ++i) { + if(i) { *(buffer++) = ' '; --buflen; } // prepend space + if(PrintAtom((*this)[i],buffer,buflen)) { + int len = strlen(buffer); + buffer += len,buflen -= len; + } + else + ok = false; + } + return ok; +} + + bool flext::ScanAtom(t_atom &a,const char *buf) { // skip whitespace -- cgit v1.2.1