summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Util.cpp')
-rw-r--r--cpp/src/Slice/Util.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index b5e3cc942e0..3ea6b609c9e 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -349,3 +349,25 @@ Slice::filterMcppWarnings(const string& message)
}
return out;
}
+
+void
+Slice::printGeneratedHeader(IceUtilInternal::Output& out, const string& path, const string& comment)
+{
+ //
+ // Get only the file name part of the given path.
+ //
+ string file = path;
+ size_t pos = file.find_last_of("/\\");
+ if(string::npos != pos)
+ {
+ file = file.substr(pos + 1);
+ }
+
+ out << "\n\n" << comment << " <auto-generated>";
+ out << "\n" << comment;
+ out << "\n" << comment << " Generated from file `" << file << "'";
+ out << "\n" << comment;
+ out << "\n" << comment << " Warning: do not edit this file.";
+ out << "\n" << comment;
+ out << "\n" << comment << " </auto-generated>\n";
+}