X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdASCII.cxx;h=fa2e686d2d33a7a8c7067d8b7e5695cdc89908c3;hb=e68a062addb8d49203f887b1e4ce4379e5890d1a;hp=316d47373b984e62fd667ce90d6234dfc7534209;hpb=2593029cb1c4a272c6502cc9abc82f980d479739;p=bbtk.git diff --git a/packages/std/src/bbstdASCII.cxx b/packages/std/src/bbstdASCII.cxx index 316d473..fa2e686 100644 --- a/packages/std/src/bbstdASCII.cxx +++ b/packages/std/src/bbstdASCII.cxx @@ -1,70 +1,99 @@ -#include "bbstdASCII.h" -#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; +/*========================================================================= + Program: bbtk + Module: $RCSfile: bbstdASCII.cxx,v $ + Language: C++ + Date: $Date: 2009/05/14 14:43:38 $ + Version: $Revision: 1.7 $ +=========================================================================*/ - pos1=pos2+1; - pos2 = commandstr.find(" ",pos2+1); - } // while - } // if type 0 +/* --------------------------------------------------------------------- - if (bbGetInputtype()==1){ - int i,size=bbGetInputIn().size(); - for (i=0;i