]>
Dogcows Code - chaz/yoink/blob - src/stlplus/persistence/persistent_exceptions.cpp
1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
8 ////////////////////////////////////////////////////////////////////////////////
10 #include "persistent_exceptions.hpp"
13 ////////////////////////////////////////////////////////////////////////////////
15 static std::string
to_string(int number
)
17 // use sprintf in a very controlled way that cannot overrun
18 char* buffer
= new char[50];
19 sprintf(buffer
, "%i", number
);
20 std::string result
= buffer
;
25 ////////////////////////////////////////////////////////////////////////////////
28 stlplus::persistent_illegal_type::persistent_illegal_type(const std::string
& type
) throw() :
29 std::logic_error(std::string("illegal type: ") + type
)
33 stlplus::persistent_illegal_type::persistent_illegal_type(unsigned key
) throw() :
34 std::logic_error(std::string("illegal key: ") + to_string((int)key
))
38 stlplus::persistent_illegal_type::~persistent_illegal_type(void) throw()
42 ////////////////////////////////////////////////////////////////////////////////
44 stlplus::persistent_dump_failed::persistent_dump_failed(const std::string
& message
) throw() :
45 std::runtime_error(std::string("dump failed: ") + message
)
49 stlplus::persistent_dump_failed::~persistent_dump_failed(void) throw()
53 ////////////////////////////////////////////////////////////////////////////////
55 stlplus::persistent_restore_failed::persistent_restore_failed(const std::string
& message
) throw() :
56 std::runtime_error(std::string("restore failed: ") + message
)
60 stlplus::persistent_restore_failed::~persistent_restore_failed(void) throw()
64 ////////////////////////////////////////////////////////////////////////////////
This page took 0.03187 seconds and 4 git commands to generate.