--- libgig/trunk/src/Serialization.cpp 2017/05/17 15:55:18 3186 +++ libgig/trunk/src/Serialization.cpp 2017/05/21 12:46:05 3198 @@ -2286,6 +2286,20 @@ // *************** Exception *************** // * + Exception::Exception() { + } + + Exception::Exception(String format, ...) { + va_list arg; + va_start(arg, format); + Message = assemble(format, arg); + va_end(arg); + } + + Exception::Exception(String format, va_list arg) { + Message = assemble(format, arg); + } + /** @brief Print exception message to stdout. * * Prints the message of this Exception to the currently defined standard @@ -2295,4 +2309,12 @@ std::cout << "Serialization::Exception: " << Message << std::endl; } + String Exception::assemble(String format, va_list arg) { + char* buf = NULL; + vasprintf(&buf, format.c_str(), arg); + String s = buf; + free(buf); + return s; + } + } // namespace Serialization