summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-21 22:15:13 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-21 22:15:13 +0100
commitb882fffeaa5235fc1fe86f13c16de55d64743a52 (patch)
tree55c3879ee16231bcebdc8d537df4923e55d0d6b7
parentAllow default constructor of parser, set options and execute instead of multi... (diff)
downloadslicer-b882fffeaa5235fc1fe86f13c16de55d64743a52.tar.bz2
slicer-b882fffeaa5235fc1fe86f13c16de55d64743a52.tar.xz
slicer-b882fffeaa5235fc1fe86f13c16de55d64743a52.zip
Allow overriding the default slicer/ header prefix
-rw-r--r--slicer/tool/parser.cpp3
-rw-r--r--slicer/tool/parser.h1
-rw-r--r--slicer/tool/slicer.cpp5
3 files changed, 5 insertions, 4 deletions
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index d2332b1..d6cb6c0 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -17,6 +17,7 @@ namespace fs = boost::filesystem;
namespace Slicer {
Slicer::Slicer() :
cpp(NULL),
+ headerPrefix("slicer"),
allowIcePrefix(false),
components(0),
classNo(0)
@@ -117,7 +118,7 @@ namespace Slicer {
fprintbf(cpp, "// Begin Slicer code\n\n");
fprintbf(cpp, "#include <%s>\n\n", fs::change_extension(topLevelFile.filename(), ".h").string());
- fprintbf(cpp, "#include <slicer/modelPartsTypes.impl.h>\n\n");
+ fprintbf(cpp, "#include <%s>\n\n", (headerPrefix / "modelPartsTypes.impl.h").string());
fprintbf(cpp, "namespace Slicer {\n");
return true;
}
diff --git a/slicer/tool/parser.h b/slicer/tool/parser.h
index 4ae7752..a58df3a 100644
--- a/slicer/tool/parser.h
+++ b/slicer/tool/parser.h
@@ -28,6 +28,7 @@ namespace Slicer {
FILE * cpp;
boost::filesystem::path slicePath;
boost::filesystem::path cppPath;
+ boost::filesystem::path headerPrefix;
std::vector<boost::filesystem::path> includes;
bool allowIcePrefix;
diff --git a/slicer/tool/slicer.cpp b/slicer/tool/slicer.cpp
index c150dcf..e97483e 100644
--- a/slicer/tool/slicer.cpp
+++ b/slicer/tool/slicer.cpp
@@ -12,7 +12,8 @@ main(int argc, char ** argv)
opts.add_options()
("help,h", "Show this help message")
("include,I", po::value(&slicer.includes), "Add include directory to search path")
- ("ice", po::value(&slicer.allowIcePrefix)->default_value(false)->zero_tokens(), "Allow reserved Ice prefix in Slice identifiers")
+ ("ice", po::value(&slicer.allowIcePrefix)->default_value(slicer.allowIcePrefix)->zero_tokens(), "Allow reserved Ice prefix in Slice identifiers")
+ ("headerPrefix", po::value(&slicer.headerPrefix)->default_value(slicer.headerPrefix), "Prefix path for Slicer C++ #includes")
("slice,i", po::value(&slicer.slicePath), "Input ICE Slice file")
("cpp,o", po::value(&slicer.cppPath), "Output C++ file");
@@ -35,5 +36,3 @@ main(int argc, char ** argv)
return 0;
}
-
-