From ce298ad2e8dbc3601d180c178bee9d606b8edab2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Mar 2013 10:45:12 +0200 Subject: Add convenience constructors to XML parsing and serialization exceptions --- cutl/xml/serializer.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'cutl/xml/serializer.cxx') diff --git a/cutl/xml/serializer.cxx b/cutl/xml/serializer.cxx index 3919635..8da3df5 100644 --- a/cutl/xml/serializer.cxx +++ b/cutl/xml/serializer.cxx @@ -22,14 +22,27 @@ namespace cutl serialization (const string& n, const string& d) : name_ (n), description_ (d) { - if (!n.empty ()) + init (); + } + + serialization:: + serialization (const serializer& s, const std::string& d) + : name_ (s.output_name ()), description_ (d) + { + init (); + } + + void serialization:: + init () + { + if (!name_.empty ()) { - what_ += n; + what_ += name_; what_ += ": "; } what_ += "error: "; - what_ += d; + what_ += description_; } char const* serialization:: -- cgit v1.1