aboutsummaryrefslogtreecommitdiff
path: root/src/functioncommandtolist.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/functioncommandtolist.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/functioncommandtolist.cpp b/src/functioncommandtolist.cpp
deleted file mode 100644
index 68c4564..0000000
--- a/src/functioncommandtolist.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
1#include "functioncommandtolist.h"
2#include "bu/plugger.h"
3
4PluginInterface2(commandToList, FunctionCommandToList, Function, "Mike Buland", 0, 1 );
5
6FunctionCommandToList::FunctionCommandToList()
7{
8}
9
10FunctionCommandToList::~FunctionCommandToList()
11{
12}
13
14void FunctionCommandToList::execute( Build *bld, const StringList &lInput, StringList &lOutput )
15{
16 //rView.beginExtraRequiresCheck( s.c_str() );
17 //rView.executeCmd( s.c_str() );
18 FILE *fcmd = popen( lParams.front().c_str(), "r" );
19 std::string rhs;
20 bool bHeader = true;
21 for(;;)
22 {
23 if( feof( fcmd ) )
24 break;
25 int cc = fgetc( fcmd );
26 if( cc == EOF )
27 break;
28 unsigned char c = cc;
29 if( bHeader )
30 {
31 if( c == ':' )
32 bHeader = false;
33 }
34 else
35 {
36 if( c == ' ' || c == '\t' )
37 {
38 if( rhs != "" )
39 {
40 lOutput.push_back( rhs );
41 rhs = "";
42 }
43 }
44 else
45 {
46 if( c == '\\' )
47 c = fgetc( fcmd );
48 if( c != '\n' )
49 rhs += c;
50 }
51 }
52 }
53 if( rhs != "" )
54 {
55 lOutput.push_back( rhs );
56 rhs = "";
57 }
58 pclose( fcmd );
59 //rView.endExtraRequiresCheck();
60}
61
62Function *FunctionCommandToList::duplicate( Build &bld, const StringList *cont, VarMap *mExtra )
63{
64 Function *pRet = new FunctionCommandToList();
65 pRet->copyData( this, bld, cont, mExtra );
66 return pRet;
67}
68