diff options
Diffstat (limited to 'cpp/src/slice2html/Gen.cpp')
-rw-r--r-- | cpp/src/slice2html/Gen.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index e477449255d..c3c51ae2868 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -30,15 +30,30 @@ using namespace Slice; using namespace IceUtil; using namespace IceUtilInternal; +// +// Callback for Crtl-C signal handling +// +static GeneratorBase* _genBase = 0; + +static void closeCallback() +{ + if(_genBase != 0) + { + _genBase->closeStream(); + } +} + + namespace Slice { void -generate(const UnitPtr& unit, const string& dir, - const string& header, const string& footer, - const string& indexHeader, const string& indexFooter, - const string& imageDir, const string& logoURL, const string& searchAction, unsigned indexCount, unsigned warnSummary) +generate(const UnitPtr& unit, const string& dir, const string& header, const string& footer, + const string& indexHeader, const string& indexFooter, const string& imageDir, const string& logoURL, + const string& searchAction, unsigned indexCount, unsigned warnSummary) { + SignalHandler::setCallback(closeCallback); + unit->mergeModules(); // @@ -197,10 +212,12 @@ Slice::GeneratorBase::setSymbols(const ContainedList& symbols) Slice::GeneratorBase::GeneratorBase(XMLOutput& o, const Files& files) : _out(o), _files(files) { + _genBase = this; } Slice::GeneratorBase::~GeneratorBase() { + _genBase = 0; } // @@ -1203,6 +1220,12 @@ Slice::GeneratorBase::openStream(const string& path) } } +void +Slice::GeneratorBase::closeStream() +{ + _out.close(); +} + string Slice::GeneratorBase::containedToId(const ContainedPtr& contained, bool asTarget) { |