]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/lexicalcast.h
Throw from LexicalConverter::get if no conversion was performed
[libs/core.git] / source / strings / lexicalcast.h
index 80963f44dd3a233ff2d16b01ec007935d01e73c9..25e3268126bde5d65cf19dca35d188c96dcebb5e 100644 (file)
@@ -35,14 +35,15 @@ class LexicalConverter
 {
 private:
        Fmt fmt;
+       bool filled;
        std::string buf;
 
 public:
-       LexicalConverter(const Fmt &f): fmt(f) { }
-       LexicalConverter(const std::string &s, const Fmt &f): fmt(f), buf(s) { }
+       LexicalConverter(const Fmt &f): fmt(f), filled(false) { }
+       LexicalConverter(const std::string &s, const Fmt &f): fmt(f), filled(true), buf(s) { }
 
        const Fmt &get_fmt() const { return fmt; }
-       const std::string &get() const { return buf; }
+       const std::string &get() const;
        void result(const std::string &);
 };