summaryrefslogtreecommitdiff
path: root/xsd/xsd/xsd.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/xsd/xsd.hxx')
-rw-r--r--xsd/xsd/xsd.hxx81
1 files changed, 11 insertions, 70 deletions
diff --git a/xsd/xsd/xsd.hxx b/xsd/xsd/xsd.hxx
index 508c8da..8b9d6fe 100644
--- a/xsd/xsd/xsd.hxx
+++ b/xsd/xsd/xsd.hxx
@@ -1,84 +1,25 @@
// file : xsd/xsd.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSD_HXX
#define XSD_HXX
-#include <xsd-frontend/semantic-graph/elements.hxx> // Path
-
-#include <cult/types.hxx>
-#include <cult/containers/set.hxx>
-#include <cult/containers/vector.hxx>
-
-
+#include <set>
+#include <vector>
#include <cstdio> // std::remove
-using namespace Cult::Types;
-
-//
-//
-typedef Cult::Containers::Set<NarrowString> WarningSet;
+#include <cutl/shared-ptr.hxx>
+#include <cutl/fs/auto-remove.hxx>
-//
-//
-typedef Cult::Containers::Vector<NarrowString> FileList;
-
-//
-//
-struct AutoUnlink
-{
- AutoUnlink (XSDFrontend::SemanticGraph::Path const& file)
- : file_ (file), canceled_ (false)
- {
- }
-
- ~AutoUnlink ()
- {
- if (!canceled_)
- {
-#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2
- std::remove (file_.native_file_string ().c_str ());
-#else
- std::remove (file_.string ().c_str ());
-#endif
- }
- }
-
- void
- cancel ()
- {
- canceled_ = true;
- }
-
-private:
- XSDFrontend::SemanticGraph::Path file_;
- Boolean canceled_;
-};
+#include <xsd-frontend/semantic-graph/elements.hxx> // Path
-//
-//
-struct AutoUnlinks
-{
- Void
- add (XSDFrontend::SemanticGraph::Path const& file)
- {
- unlinks_.push_back (Evptr<AutoUnlink> (new AutoUnlink (file)));
- }
+#include <types.hxx>
- Void
- cancel ()
- {
- for (Unlinks::Iterator i (unlinks_.begin ()); i != unlinks_.end (); ++i)
- {
- (*i)->cancel ();
- }
- }
+typedef std::set<NarrowString> WarningSet;
+typedef std::vector<NarrowString> FileList;
-private:
- typedef Cult::Containers::Vector<Evptr<AutoUnlink> > Unlinks;
- Unlinks unlinks_;
-};
+typedef cutl::fs::auto_remove AutoUnlink;
+typedef cutl::fs::auto_removes AutoUnlinks;
#endif // XSD_HXX