/[svn]/libgig/trunk/src/Serialization.cpp
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3197 by schoenebeck, Wed May 17 15:55:18 2017 UTC revision 3198 by schoenebeck, Sun May 21 12:46:05 2017 UTC
# Line 2286  namespace Serialization { Line 2286  namespace Serialization {
2286      // *************** Exception ***************      // *************** Exception ***************
2287      // *      // *
2288    
2289        Exception::Exception() {
2290        }
2291    
2292        Exception::Exception(String format, ...) {
2293            va_list arg;
2294            va_start(arg, format);
2295            Message = assemble(format, arg);
2296            va_end(arg);
2297        }
2298    
2299        Exception::Exception(String format, va_list arg) {
2300            Message = assemble(format, arg);
2301        }
2302    
2303      /** @brief Print exception message to stdout.      /** @brief Print exception message to stdout.
2304       *       *
2305       * Prints the message of this Exception to the currently defined standard       * Prints the message of this Exception to the currently defined standard
# Line 2295  namespace Serialization { Line 2309  namespace Serialization {
2309          std::cout << "Serialization::Exception: " << Message << std::endl;          std::cout << "Serialization::Exception: " << Message << std::endl;
2310      }      }
2311    
2312        String Exception::assemble(String format, va_list arg) {
2313            char* buf = NULL;
2314            vasprintf(&buf, format.c_str(), arg);
2315            String s = buf;
2316            free(buf);
2317            return s;
2318        }
2319    
2320  } // namespace Serialization  } // namespace Serialization

Legend:
Removed from v.3197  
changed lines
  Added in v.3198

  ViewVC Help
Powered by ViewVC