summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-29 10:27:38 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-29 10:27:38 -0700
commitbae6192c54533e8da95d8ae1ed4d4eccee28c39a (patch)
treef27b03b518894420992ad1a3ed3ee1a07935ca4b /src/command.cpp
parent550d4f13ace49e3d442e43d46cd066f174709400 (diff)
downloadstage-bae6192c54533e8da95d8ae1ed4d4eccee28c39a.tar.gz
stage-bae6192c54533e8da95d8ae1ed4d4eccee28c39a.tar.bz2
stage-bae6192c54533e8da95d8ae1ed4d4eccee28c39a.tar.xz
stage-bae6192c54533e8da95d8ae1ed4d4eccee28c39a.zip
Getting close to realy running.
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp46
1 files changed, 46 insertions, 0 deletions
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 @@
1#include "command.h"
2
3#include "astbranch.h"
4
5#include <bu/sio.h>
6using namespace Bu;
7
8Command::Command() :
9 pAst( NULL )
10{
11}
12
13Command::~Command()
14{
15 delete pAst;
16}
17
18void Command::addLiteral( const Bu::String &sValue )
19{
20 lChunks.append( Chunk( true, sValue ) );
21}
22
23void Command::addParam( const Bu::String &sValue )
24{
25 lChunks.append( Chunk( false, sValue ) );
26}
27
28void Command::setAst( class AstBranch *pAst )
29{
30 this->pAst = pAst;
31}
32
33void Command::print()
34{
35 sio << "command:";
36 for( ChunkList::iterator i = lChunks.begin(); i; i++ )
37 {
38 if( (*i).bLiteral )
39 sio << " \"" << (*i).sValue << "\"";
40 else
41 sio << " " << (*i).sValue;
42 }
43
44 sio << sio.nl;
45}
46