1 #ifndef MSP_STRINGCODEC_EXCEPT_H_
2 #define MSP_STRINGCODEC_EXCEPT_H_
8 namespace StringCodec {
11 Base class for codec errors.
13 class codec_error: public std::runtime_error
16 codec_error(const std::string &w): std::runtime_error(w) { }
17 virtual ~codec_error() throw() { }
22 Thrown when a codec can't encode the requested character.
24 class invalid_character: public codec_error
27 invalid_character(unichar, const std::string &);
28 virtual ~invalid_character() throw() { }
33 Thrown when a codec encounters a byte sequence it can't decode.
35 class invalid_sequence: public codec_error
38 invalid_sequence(const std::string::const_iterator &, const std::string::const_iterator &, const std::string &);
39 virtual ~invalid_sequence() throw() { }
42 std::string format_sequence(const std::string::const_iterator &, const std::string::const_iterator &);
45 } // namespace StringCodec