split files

This commit is contained in:
ToruNiina
2017-04-21 13:14:53 +09:00
parent 337a671f0c
commit 78f25dd66d
8 changed files with 389 additions and 322 deletions

52
toml/exception.hpp Normal file
View File

@@ -0,0 +1,52 @@
#ifndef TOML11_EXCEPTION
#define TOML11_EXCEPTION
#include <stdexcept>
#include <string>
namespace toml
{
struct exception : public std::exception
{
public:
virtual ~exception() override = default;
virtual const char* what() const noexcept override {return "";}
};
struct syntax_error : public toml::exception
{
public:
explicit syntax_error(const std::string& what_arg) : what_(what_arg){}
explicit syntax_error(const char* what_arg) : what_(what_arg){}
virtual ~syntax_error() override = default;
virtual const char* what() const noexcept override {return what_.c_str();}
protected:
std::string what_;
};
struct type_error : public toml::exception
{
public:
explicit type_error(const std::string& what_arg) : what_(what_arg){}
explicit type_error(const char* what_arg) : what_(what_arg){}
virtual ~type_error() override = default;
virtual const char* what() const noexcept override {return what_.c_str();}
protected:
std::string what_;
};
struct internal_error : public toml::exception
{
public:
explicit internal_error(const std::string& what_arg) : what_(what_arg){}
explicit internal_error(const char* what_arg) : what_(what_arg){}
virtual ~internal_error() override = default;
virtual const char* what() const noexcept override {return what_.c_str();}
protected:
std::string what_;
};
} // toml
#endif // TOML_EXCEPTION