summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-04-13 14:58:28 +0200
committerJose <jose@zeroc.com>2015-04-13 14:58:28 +0200
commit8cff2a828400acb3769b7b05452ac267725086eb (patch)
tree3735ea75f8890fcec71909b0ce4cc616bd14d30a /cpp/src/Slice/Util.cpp
parentICE-6445 Remove .NET CF support (diff)
downloadice-8cff2a828400acb3769b7b05452ac267725086eb.tar.bz2
ice-8cff2a828400acb3769b7b05452ac267725086eb.tar.xz
ice-8cff2a828400acb3769b7b05452ac267725086eb.zip
Add --depend-file/--depend-xml optinos to all Slice compilers
Diffstat (limited to 'cpp/src/Slice/Util.cpp')
-rw-r--r--cpp/src/Slice/Util.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index 5ddd8c6c8b9..cacad7217f0 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -395,3 +395,38 @@ Slice::printGeneratedHeader(IceUtilInternal::Output& out, const string& path, co
out << comment << " </auto-generated>\n";
out << comment << "\n";
}
+
+Slice::DependOutputUtil::DependOutputUtil(string& file) : _file(file)
+{
+ if(!_file.empty())
+ {
+ _os.open(file, ios::out);
+ }
+}
+
+Slice::DependOutputUtil::~DependOutputUtil()
+{
+ if(!_file.empty() && _os.is_open())
+ {
+ _os.close();
+ }
+}
+
+void
+Slice::DependOutputUtil::cleanup()
+{
+ if(!_file.empty())
+ {
+ if(_os.is_open())
+ {
+ _os.close();
+ }
+ IceUtilInternal::unlink(_file);
+ }
+}
+
+ostream&
+Slice::DependOutputUtil::os()
+{
+ return _file.empty() ? cout : _os;
+}