X-Git-Url: http://git.tdb.fi/?p=builder.git;a=blobdiff_plain;f=source%2Ftool.cpp;h=e2afe79a204ccea8aebda5294c0dc8a0fd3f583e;hp=3aa2db3c713716ba7d90bcafa715afe368a37302;hb=4e2a160d94ca808cfb511cc2d38e115d989809f2;hpb=5033a9de732963dfcadc42ad381df00b69cf624d diff --git a/source/tool.cpp b/source/tool.cpp index 3aa2db3..e2afe79 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -12,6 +12,7 @@ Tool::Tool(Builder &b, const string &t): architecture(0), tag(t), executable(0), + processing_unit(ONE_FILE), prepared(false) { } @@ -20,6 +21,7 @@ Tool::Tool(Builder &b, const Architecture &a, const string &t): architecture(&a), tag(t), executable(0), + processing_unit(ONE_FILE), prepared(false) { } @@ -71,3 +73,17 @@ SubTool::SubTool(Tool &p): Tool(p), parent(p) { } + + +void operator>>(const LexicalConverter &conv, Tool::ProcessingUnit &unit) +{ + const string &str = conv.get(); + if(str=="FILE") + unit = Tool::ONE_FILE; + else if(str=="DIRECTORY") + unit = Tool::DIRECTORY; + else if(str=="COMPONENT") + unit = Tool::COMPONENT; + else + throw lexical_error(format("conversion of '%s' to ProcessingUnit", str)); +}