From bae6192c54533e8da95d8ae1ed4d4eccee28c39a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 29 Dec 2011 10:27:38 -0700 Subject: Getting close to realy running. --- src/command.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/command.cpp (limited to 'src/command.cpp') diff --git a/src/command.cpp b/src/command.cpp new file mode 100644 index 0000000..5b859f7 --- /dev/null +++ b/src/command.cpp @@ -0,0 +1,46 @@ +#include "command.h" + +#include "astbranch.h" + +#include +using namespace Bu; + +Command::Command() : + pAst( NULL ) +{ +} + +Command::~Command() +{ + delete pAst; +} + +void Command::addLiteral( const Bu::String &sValue ) +{ + lChunks.append( Chunk( true, sValue ) ); +} + +void Command::addParam( const Bu::String &sValue ) +{ + lChunks.append( Chunk( false, sValue ) ); +} + +void Command::setAst( class AstBranch *pAst ) +{ + this->pAst = pAst; +} + +void Command::print() +{ + sio << "command:"; + for( ChunkList::iterator i = lChunks.begin(); i; i++ ) + { + if( (*i).bLiteral ) + sio << " \"" << (*i).sValue << "\""; + else + sio << " " << (*i).sValue; + } + + sio << sio.nl; +} + -- cgit v1.2.3