mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Move to_local8bit_failure class to docstring.cpp and restore std::bad_cast inheritance.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21307 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
13a85fe0c0
commit
036a507c6d
@ -109,10 +109,16 @@ docstring const from_local8bit(std::string const & s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char* to_local8bit_failure::what() const throw()
|
/// Exception thrown by to_local8bit if the string could not be converted
|
||||||
{
|
class to_local8bit_failure : public std::bad_cast {
|
||||||
return "A string could not be converted from unicode to the local 8 bit encoding.";
|
public:
|
||||||
}
|
to_local8bit_failure() throw() : std::bad_cast() {}
|
||||||
|
virtual ~to_local8bit_failure() throw() {}
|
||||||
|
virtual const char* what() const throw()
|
||||||
|
{
|
||||||
|
return "A string could not be converted from unicode to the local 8 bit encoding.";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
std::string const to_local8bit(docstring const & s)
|
std::string const to_local8bit(docstring const & s)
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "support/types.h"
|
#include "support/types.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
//#include <typeinfo>
|
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
@ -41,14 +40,6 @@ std::string const to_utf8(docstring const &);
|
|||||||
/// convert \p s from the encoding of the locale to ucs4.
|
/// convert \p s from the encoding of the locale to ucs4.
|
||||||
docstring const from_local8bit(std::string const & s);
|
docstring const from_local8bit(std::string const & s);
|
||||||
|
|
||||||
/// Exception thrown by to_local8bit if the string could not be converted
|
|
||||||
class to_local8bit_failure /*: public std::bad_cast*/ {
|
|
||||||
public:
|
|
||||||
to_local8bit_failure() throw() /*: std::bad_cast()*/ {}
|
|
||||||
virtual ~to_local8bit_failure() throw() {}
|
|
||||||
virtual const char* what() const throw();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert \p s from ucs4 to the encoding of the locale.
|
* Convert \p s from ucs4 to the encoding of the locale.
|
||||||
* This may fail and throw an exception, the caller is expected to act
|
* This may fail and throw an exception, the caller is expected to act
|
||||||
|
Loading…
Reference in New Issue
Block a user