X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdASCII.cxx;h=c24da54f26b8be29ef98e7bf766fd637e50eca74;hb=4ad5b5ee44357ad873bc8c43230defb6d0a79879;hp=316d47373b984e62fd667ce90d6234dfc7534209;hpb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;p=bbtk.git diff --git a/packages/std/src/bbstdASCII.cxx b/packages/std/src/bbstdASCII.cxx index 316d473..c24da54 100644 --- a/packages/std/src/bbstdASCII.cxx +++ b/packages/std/src/bbstdASCII.cxx @@ -2,69 +2,69 @@ #include "bbstdPackage.h" namespace bbstd { - - BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ASCII) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ASCII,bbtk::AtomicBlackBox); - void ASCII::Process() - { - int asciiValue; - char strTmp[10]; - std::string result(""); - if (bbGetInputIn()!=""){ - - if (bbGetInputtype()==0){ - std::string commandstr(bbGetInputIn()); - bool ok=true; - int pos1=0,pos2; - pos2 = commandstr.find(" ",pos1); - std::string ccommand; - while (ok==true) - { - if (pos2==-1) - { - ok=false; - ccommand=commandstr.substr(pos1,commandstr.length()-pos1 ); - } else { - ccommand=commandstr.substr(pos1,pos2-pos1); - } - asciiValue = atoi( ccommand.c_str() ); - sprintf(strTmp,"%c",asciiValue); - result += strTmp; - - pos1=pos2+1; - pos2 = commandstr.find(" ",pos2+1); - } // while - } // if type 0 - - if (bbGetInputtype()==1){ - int i,size=bbGetInputIn().size(); - for (i=0;i