2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2016 by Christian Schoenebeck * |
* Copyright (C) 2003-2017 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
2251 |
// *************** Exception *************** |
// *************** Exception *************** |
2252 |
// * |
// * |
2253 |
|
|
2254 |
|
Exception::Exception() { |
2255 |
|
} |
2256 |
|
|
2257 |
|
Exception::Exception(String format, ...) { |
2258 |
|
va_list arg; |
2259 |
|
va_start(arg, format); |
2260 |
|
Message = assemble(format, arg); |
2261 |
|
va_end(arg); |
2262 |
|
} |
2263 |
|
|
2264 |
|
Exception::Exception(String format, va_list arg) { |
2265 |
|
Message = assemble(format, arg); |
2266 |
|
} |
2267 |
|
|
2268 |
void Exception::PrintMessage() { |
void Exception::PrintMessage() { |
2269 |
std::cout << "RIFF::Exception: " << Message << std::endl; |
std::cout << "RIFF::Exception: " << Message << std::endl; |
2270 |
} |
} |
2271 |
|
|
2272 |
|
String Exception::assemble(String format, va_list arg) { |
2273 |
|
char* buf = NULL; |
2274 |
|
vasprintf(&buf, format.c_str(), arg); |
2275 |
|
String s = buf; |
2276 |
|
free(buf); |
2277 |
|
return s; |
2278 |
|
} |
2279 |
|
|
2280 |
|
|
2281 |
// *************** functions *************** |
// *************** functions *************** |
2282 |
// * |
// * |