summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-10-03 01:07:56 +0200
committerJose <jose@zeroc.com>2009-10-03 01:07:56 +0200
commita00430c3a79067e9bdd5a62620fcfbc9da536601 (patch)
treedbda5220894c256cf73725c6f17d618b8289152d /cpp/src/Slice/Util.cpp
parentFixes related to 3772: (diff)
downloadice-a00430c3a79067e9bdd5a62620fcfbc9da536601.tar.bz2
ice-a00430c3a79067e9bdd5a62620fcfbc9da536601.tar.xz
ice-a00430c3a79067e9bdd5a62620fcfbc9da536601.zip
4190 - Add header to generated files to indicate they are autogenerated.
commit 910bdd9d5cd71ac2cd357dbe5ee82b7ae81fca89 Merge: 429a086 1873f9f Author: Jose <jose@zeroc.com> Date: Sat Oct 3 01:00:34 2009 +0200
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";
+}