bbstd::ASCII Class Reference

#include <bbstdASCII.h>

List of all members.

Private Member Functions

 BBTK_BLACK_BOX_INTERFACE (ASCII, bbtk::AtomicBlackBox)
virtual void bbUserConstructor ()
 User callback called in the box contructor.
virtual void bbUserCopyConstructor ()
 User callback called in the box copy constructor.
virtual void bbUserDestructor ()
 User callback called in the box destructor.
 BBTK_DECLARE_INPUT (In, std::string)
 BBTK_DECLARE_INPUT (Type, int)
 BBTK_DECLARE_OUTPUT (Out, std::string)
 BBTK_PROCESS (Process)
void Process ()


Detailed Description

Definition at line 40 of file bbstdASCII.h.


Member Function Documentation

bbstd::ASCII::BBTK_BLACK_BOX_INTERFACE ( ASCII  ,
bbtk::AtomicBlackBox   
) [private]

void bbstd::ASCII::bbUserConstructor (  )  [private, virtual]

User callback called in the box contructor.

Definition at line 85 of file bbstdASCII.cxx.

00086   {
00087     bbSetInputIn("");
00088     bbSetInputType(0);
00089   }

void bbstd::ASCII::bbUserCopyConstructor (  )  [private, virtual]

User callback called in the box copy constructor.

Definition at line 91 of file bbstdASCII.cxx.

00092   {    
00093   }

void bbstd::ASCII::bbUserDestructor (  )  [private, virtual]

User callback called in the box destructor.

Definition at line 95 of file bbstdASCII.cxx.

00096   {
00097   }

bbstd::ASCII::BBTK_DECLARE_INPUT ( In  ,
std::string   
) [private]

bbstd::ASCII::BBTK_DECLARE_INPUT ( Type  ,
int   
) [private]

bbstd::ASCII::BBTK_DECLARE_OUTPUT ( Out  ,
std::string   
) [private]

bbstd::ASCII::BBTK_PROCESS ( Process   )  [private]

void bbstd::ASCII::Process (  )  [private]

Definition at line 39 of file bbstdASCII.cxx.

00040   {
00041     int asciiValue;
00042     char strTmp[10];
00043     std::string result("");
00044     if (bbGetInputIn()!=""){
00045       
00046       if (bbGetInputType()==0){
00047         std::string commandstr(bbGetInputIn());
00048         bool ok=true;
00049         int pos1=0,pos2;
00050         pos2 = commandstr.find(" ",pos1);
00051         std::string ccommand;
00052         while (ok==true)
00053           {
00054             if (pos2==-1)       
00055               {
00056                 ok=false;
00057                 ccommand=commandstr.substr(pos1,commandstr.length()-pos1 );
00058               }         else  {
00059               ccommand=commandstr.substr(pos1,pos2-pos1);
00060             }
00061             asciiValue = atoi( ccommand.c_str() );
00062             sprintf(strTmp,"%c",asciiValue);
00063             result += strTmp;
00064             
00065             pos1=pos2+1;
00066             pos2 = commandstr.find(" ",pos2+1);
00067           } // while
00068       } // if Type 0
00069       
00070       if (bbGetInputType()==1){
00071         int i,size=bbGetInputIn().size();
00072         for (i=0;i<size;i++){
00073           asciiValue = (int)bbGetInputIn()[i];
00074           sprintf(strTmp,"%d",asciiValue);
00075           result +=strTmp;
00076           if (i!=size-1) {
00077             result +=" ";
00078           } // i!=size-1
00079         } // for
00080       } // Type 1
00081     }
00082     bbSetOutputOut( result );  
00083   }


The documentation for this class was generated from the following files:

Generated on Tue Oct 21 16:06:50 2008 for std by  doxygen 1.5.6