X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdASCII.cxx;h=69b504745dc246fceec5e2677d64470818dc9f7f;hb=6575a389b71b1b85c79e4444885becb76ecf16e4;hp=316d47373b984e62fd667ce90d6234dfc7534209;hpb=2593029cb1c4a272c6502cc9abc82f980d479739;p=bbtk.git diff --git a/packages/std/src/bbstdASCII.cxx b/packages/std/src/bbstdASCII.cxx index 316d473..69b5047 100644 --- a/packages/std/src/bbstdASCII.cxx +++ b/packages/std/src/bbstdASCII.cxx @@ -1,70 +1,100 @@ -#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: 2008/10/17 08:18:26 $ + Version: $Revision: 1.5 $ +=========================================================================*/ - pos1=pos2+1; - pos2 = commandstr.find(" ",pos2+1); - } // while - } // if type 0 +/* --------------------------------------------------------------------- - if (bbGetInputtype()==1){ - int i,size=bbGetInputIn().size(); - for (i=0;i