proj home

Files   Classes   Functions   Hierarchy  

viscmd.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 using namespace std;
00003 
00004 #include <viscmd.h>
00005 
00006 viscmd::viscmd(stringc command_, stringc arg_)
00007   : command(command_), arg(arg_), valid(false), enabled(true)
00008 {
00009 }
00010 
00011 viscmd::viscmd()
00012   : command(""), arg(""), 
00013   valid(false), enabled(true)
00014 
00015 {
00016 }
00017 
00018 viscmd::operator string() const
00019 {
00020   string s;
00021   s = "<viscmd><command>";
00022   s += command;
00023   s += "</command><arg>";
00024   s += arg;
00025   s += "</arg><valid>";
00026   if (valid)
00027     s += "1";
00028   else
00029     s += "0";
00030   s += "</valid>";
00031   s += "<enabled>";
00032   if (enabled)
00033     s += "1";
00034   else
00035     s += "0";
00036   s += "</enabled>";
00037   s += "</viscmd>";
00038 ;
00039   return s;
00040 }
00041 
00042 void viscmd::serializeInverse(stringc & s)
00043 {
00044   assert(false); //TODO  
00045 }
00046 
00047 
00048 
00049 
00050 /*
00051 void viscmd::vectorbuild
00052 (
00053   vector<viscmd> & v, 
00054   string[] & cmdarray
00055 )
00056 {
00057   uint imax=sizeof(cmdarray)/sizeof(string)/2;
00058   for (uint i=0; i<imax; ++i)
00059   {
00060     viscmd c1(cmdarray[i*2],cmdarray[i*2+1]);
00061   }
00062 }
00063 */
00064 
00065 void viscmd::printstatusinvalid(
00066  vector<viscmd>& v)
00067 {
00068   for (uint i=0; i<v.size(); ++i)
00069   {
00070     if (v[i].valid==false)
00071       cout << (string)(v[i]) << endl;
00072   }
00073 }
00074 
00075 
00076 
00077 
00078 

Generated on Fri Mar 4 00:49:31 2011 for Chelton Evans Source by  doxygen 1.5.8