summaryrefslogtreecommitdiff
path: root/cpp/src/slice2html/Gen.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2006-12-21 23:38:58 +0000
committerMichi Henning <michi@zeroc.com>2006-12-21 23:38:58 +0000
commit293e3cd141e9747a305c044d0a203d45434248d6 (patch)
tree40099d129d9e945ab596bf323ed37e7bf3eced8a /cpp/src/slice2html/Gen.cpp
parentFix typo in OutgoingAsync.cs. Added .depend rule to test/Ice/application. (diff)
downloadice-293e3cd141e9747a305c044d0a203d45434248d6.tar.bz2
ice-293e3cd141e9747a305c044d0a203d45434248d6.tar.xz
ice-293e3cd141e9747a305c044d0a203d45434248d6.zip
slice2docbook changes.
Diffstat (limited to 'cpp/src/slice2html/Gen.cpp')
-rw-r--r--cpp/src/slice2html/Gen.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp
index 33ef2d3fecd..05ccdd14f60 100644
--- a/cpp/src/slice2html/Gen.cpp
+++ b/cpp/src/slice2html/Gen.cpp
@@ -1122,17 +1122,23 @@ Slice::GeneratorBase::readFile(const string& file, string& part1, string& part2)
}
string line;
+ bool foundTitle = false;
ostringstream p1;
- getline(in, line);
- while(!line.empty() && line != "TITLE")
+ while(!foundTitle && getline(in, line))
{
- p1 << line << '\n';
- getline(in, line);
+ if(line == "TITLE")
+ {
+ foundTitle = true;
+ }
+ else
+ {
+ p1 << line << '\n';
+ }
}
part1 = p1.str();
- if(line.empty())
+ if(!foundTitle)
{
string err = "no TITLE marker in `" + file + "'";
throw err;
@@ -1140,11 +1146,9 @@ Slice::GeneratorBase::readFile(const string& file, string& part1, string& part2)
ostringstream p2;
p2 << endl;
- getline(in, line);
- while(!line.empty())
+ while(getline(in, line))
{
p2 << line << '\n';
- getline(in, line);
}
part2 = p2.str();
}