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.
TTFFontException.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 TTFFontException : public std::exception
18 {
19 public:
20  TTFFontException(const std::string &message) : msg(message){};
21  TTFFontException(const char *message, ...)
22  {
23  char msg_buf[300];
24  va_list args;
25  va_start(args, message);
26  vsnprintf(msg_buf, 300, message, args);
27  va_end(args);
28  msg = std::string(msg_buf);
29  };
30  const char *what() const noexcept override
31  {
32  return msg.c_str();
33  }
34 
35 private:
36  std::string msg;
37 };
TTFFontException(const std::string &message)
Definition: TTFFontException.h:20
const char * what() const noexcept override
Definition: TTFFontException.h:30
TTFFontException(const char *message,...)
Definition: TTFFontException.h:21
Definition: TTFFontException.h:17