TouchCPLib  1.0.0
A touch-enabled GUI interface based on SDL and libTS. It provides a simple desktop-free UI for your embedded Raspberry projects.
IMGException.h
Go to the documentation of this file.
1 #pragma once
2 
13 #include <exception>
14 #include <string>
15 #include <stdarg.h>
16 
17 class IMGException : public std::exception {
18 public:
19  IMGException(const std::string& message) : msg(message) {};
20  IMGException(const char* message, ...) {
21  char msg_buf[300];
22  va_list args;
23  va_start(args, message);
24  vsnprintf(msg_buf, 300, message, args);
25  va_end(args);
26  msg = std::string(msg_buf);
27  };
28  const char* what() const noexcept override {
29  return msg.c_str();
30  }
31 private:
32  std::string msg;
33 };
const char * what() const noexcept override
Definition: IMGException.h:28
Definition: IMGException.h:17
IMGException(const char *message,...)
Definition: IMGException.h:20
IMGException(const std::string &message)
Definition: IMGException.h:19