summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-10-06 16:21:05 +0000
committerMarc Laukien <marc@zeroc.com>2001-10-06 16:21:05 +0000
commit71294535f4176c44c033561d407952d1d0bdd9bd (patch)
treef5067365849f934c14ff75add1e13f06384ade6e /cpp/src/slice2cpp/Gen.cpp
parentfixes (diff)
downloadice-71294535f4176c44c033561d407952d1d0bdd9bd.tar.bz2
ice-71294535f4176c44c033561d407952d1d0bdd9bd.tar.xz
ice-71294535f4176c44c033561d407952d1d0bdd9bd.zip
IceUtil::Exception
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 8ac993b9233..28f0f1dbc2f 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -32,7 +32,7 @@ struct ToIfdef
};
Slice::Gen::Gen(const string& name, const string& base, const string& include, const vector<string>& includePaths,
- const string& dllExport) :
+ const string& dllExport, const string& dir) :
_base(base),
_include(include),
_includePaths(includePaths),
@@ -59,6 +59,11 @@ Slice::Gen::Gen(const string& name, const string& base, const string& include, c
string fileH = _base + ".h";
string fileC = _base + ".cpp";
+ if (!dir.empty())
+ {
+ fileH = dir + '/' + fileH;
+ fileC = dir + '/' + fileC;
+ }
H.open(fileH.c_str());
if (!H)
@@ -78,6 +83,10 @@ Slice::Gen::Gen(const string& name, const string& base, const string& include, c
printHeader(C);
string s = fileH;
+ if (_include.size())
+ {
+ s = _include + '/' + s;
+ }
transform(s.begin(), s.end(), s.begin(), ToIfdef());
H << "\n#ifndef __" << s << "__";
H << "\n#define __" << s << "__";