Fix for the bug 1583547: exception::what is a const member function
git-svn-id: http://svn.code.sf.net/p/utfcpp/code@63 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
parent
196a58c77e
commit
a2dbaf2aaf
1 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2006 Nemanja Trifunovic
|
||||
// Copyright 2006 Nemanja Trifunovic
|
||||
|
||||
/*
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
|
@ -45,7 +45,7 @@ namespace utf8
|
|||
uint32_t cp;
|
||||
public:
|
||||
invalid_code_point(uint32_t cp) : cp(cp) {}
|
||||
const char* what() { return "Invalid code point"; }
|
||||
virtual const char* what() const throw() { return "Invalid code point"; }
|
||||
uint32_t code_point() const {return cp;}
|
||||
};
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace utf8
|
|||
uint8_t u8;
|
||||
public:
|
||||
invalid_utf8 (uint8_t u) : u8(u) {}
|
||||
const char* what() { return "Invalid UTF-8"; }
|
||||
virtual const char* what() const throw() { return "Invalid UTF-8"; }
|
||||
uint8_t utf8_octet() const {return u8;}
|
||||
};
|
||||
|
||||
|
@ -61,13 +61,13 @@ namespace utf8
|
|||
uint16_t u16;
|
||||
public:
|
||||
invalid_utf16 (uint16_t u) : u16(u) {}
|
||||
const char* what() { return "Invalid UTF-16"; }
|
||||
virtual const char* what() const throw() { return "Invalid UTF-16"; }
|
||||
uint16_t utf16_word() const {return u16;}
|
||||
};
|
||||
|
||||
class not_enough_room : public std::exception {
|
||||
public:
|
||||
const char* what() { return "Not enough space"; }
|
||||
virtual const char* what() const throw() { return "Not enough space"; }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue