return 65536;
}
+ const char * buffer::error::what() const throw () {
+ return "buffer::exception";
+ }
+ const char * buffer::bad_alloc::what() const throw () {
+ return "buffer::bad_alloc";
+ }
+ const char * buffer::end_of_buffer::what() const throw () {
+ return "buffer::end_of_buffer";
+ }
+ const char * buffer::malformed_input::what() const throw () {
+ return buf;
+ }
buffer::error_code::error_code(int error) :
buffer::malformed_input(cpp_strerror(error).c_str()), code(error) {}
public:
struct error : public std::exception{
- const char *what() const throw () {
- return "buffer::exception";
- }
+ const char *what() const throw ();
};
struct bad_alloc : public error {
- const char *what() const throw () {
- return "buffer::bad_alloc";
- }
+ const char *what() const throw ();
};
struct end_of_buffer : public error {
- const char *what() const throw () {
- return "buffer::end_of_buffer";
- }
+ const char *what() const throw ();
};
struct malformed_input : public error {
explicit malformed_input(const std::string& w) {
snprintf(buf, sizeof(buf), "buffer::malformed_input: %s", w.c_str());
}
- const char *what() const throw () {
- return buf;
- }
+ const char *what() const throw ();
private:
char buf[256];
};