summaryrefslogtreecommitdiff
path: root/cpp/src/slice2docbook/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2docbook/Gen.cpp')
-rw-r--r--cpp/src/slice2docbook/Gen.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp
index d40b9e1ee75..322ca9a1147 100644
--- a/cpp/src/slice2docbook/Gen.cpp
+++ b/cpp/src/slice2docbook/Gen.cpp
@@ -9,6 +9,7 @@
#include <IceUtil/DisableWarnings.h>
#include <IceUtil/Functional.h>
+#include <Slice/FileTracker.h>
#include <Gen.h>
#include <cstring>
@@ -21,8 +22,7 @@ using namespace Slice;
using namespace IceUtil;
using namespace IceUtilInternal;
-Slice::Gen::Gen(const string& name, const string& file, bool standAlone, bool chapter,
- bool noIndex, bool sortFields) :
+Slice::Gen::Gen(const string& file, bool standAlone, bool chapter, bool noIndex, bool sortFields) :
_standAlone(standAlone),
_noIndex(noIndex),
_sortFields(sortFields)
@@ -39,8 +39,9 @@ Slice::Gen::Gen(const string& name, const string& file, bool standAlone, bool ch
O.open(file.c_str());
if(!O)
{
- cerr << name << ": can't open `" << file << "' for writing: " << strerror(errno) << endl;
- return;
+ ostringstream os;
+ os << "cannot open `" << file << "': " << strerror(errno);
+ throw FileException(__FILE__, __LINE__, os.str());
}
}
@@ -48,12 +49,6 @@ Slice::Gen::~Gen()
{
}
-bool
-Slice::Gen::operator!() const
-{
- return !O;
-}
-
void
Slice::Gen::generate(const UnitPtr& p)
{