Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/locale
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
class wstring_convert | class wstring_convert | ||||
{ | { | ||||
public: | public: | ||||
typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string; | typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string; | ||||
typedef basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string; | typedef basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string; | ||||
typedef typename Codecvt::state_type state_type; | typedef typename Codecvt::state_type state_type; | ||||
typedef typename wide_string::traits_type::int_type int_type; | typedef typename wide_string::traits_type::int_type int_type; | ||||
explicit wstring_convert(Codecvt* pcvt = new Codecvt); // explicit in C++14 | wstring_convert(Codecvt* pcvt = new Codecvt); // before C++14 | ||||
explicit wstring_convert(Codecvt* pcvt = new Codecvt); // before C++20 | |||||
wstring_convert() : wstring_convert(new Codecvt) {} // C++20 | |||||
explicit wstring_convert(Codecvt* pcvt); // C++20 | |||||
wstring_convert(Codecvt* pcvt, state_type state); | wstring_convert(Codecvt* pcvt, state_type state); | ||||
explicit wstring_convert(const byte_string& byte_err, // explicit in C++14 | explicit wstring_convert(const byte_string& byte_err, // explicit in C++14 | ||||
const wide_string& wide_err = wide_string()); | const wide_string& wide_err = wide_string()); | ||||
wstring_convert(const wstring_convert&) = delete; // C++14 | wstring_convert(const wstring_convert&) = delete; // C++14 | ||||
wstring_convert & operator=(const wstring_convert &) = delete; // C++14 | wstring_convert & operator=(const wstring_convert &) = delete; // C++14 | ||||
~wstring_convert(); | ~wstring_convert(); | ||||
wide_string from_bytes(char byte); | wide_string from_bytes(char byte); | ||||
Show All 12 Lines | |||||
template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> | template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> | ||||
class wbuffer_convert | class wbuffer_convert | ||||
: public basic_streambuf<Elem, Tr> | : public basic_streambuf<Elem, Tr> | ||||
{ | { | ||||
public: | public: | ||||
typedef typename Tr::state_type state_type; | typedef typename Tr::state_type state_type; | ||||
explicit wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, | wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, | ||||
state_type state = state_type()); // explicit in C++14 | state_type state = state_type()); // before C++14 | ||||
explicit wbuffer_convert(streambuf* bytebuf = nullptr, Codecvt* pcvt = new Codecvt, | |||||
state_type state = state_type()); // before C++20 | |||||
wbuffer_convert() : wbuffer_convert(nullptr) {} // C++20 | |||||
explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt, | |||||
state_type state = state_type()); // C++20 | |||||
wbuffer_convert(const wbuffer_convert&) = delete; // C++14 | wbuffer_convert(const wbuffer_convert&) = delete; // C++14 | ||||
wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14 | wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14 | ||||
~wbuffer_convert(); // C++14 | ~wbuffer_convert(); // C++14 | ||||
streambuf* rdbuf() const; | streambuf* rdbuf() const; | ||||
streambuf* rdbuf(streambuf* bytebuf); | streambuf* rdbuf(streambuf* bytebuf); | ||||
state_type state() const; | state_type state() const; | ||||
▲ Show 20 Lines • Show All 3,511 Lines • ▼ Show 20 Lines | private: | ||||
wide_string __wide_err_string_; | wide_string __wide_err_string_; | ||||
_Codecvt* __cvtptr_; | _Codecvt* __cvtptr_; | ||||
state_type __cvtstate_; | state_type __cvtstate_; | ||||
size_t __cvtcount_; | size_t __cvtcount_; | ||||
wstring_convert(const wstring_convert& __wc); | wstring_convert(const wstring_convert& __wc); | ||||
wstring_convert& operator=(const wstring_convert& __wc); | wstring_convert& operator=(const wstring_convert& __wc); | ||||
public: | public: | ||||
#if _LIBCPP_STD_VER > 17 | |||||
_LIBCPP_INLINE_VISIBILITY | |||||
wstring_convert() : wstring_convert(new _Codecvt) {} | |||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
_LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(_Codecvt* __pcvt = new _Codecvt); | explicit wstring_convert(_Codecvt* __pcvt); | ||||
#else | |||||
_LIBCPP_INLINE_VISIBILITY | |||||
_LIBCPP_EXPLICIT_AFTER_CXX11 | |||||
wstring_convert(_Codecvt* __pcvt = new _Codecvt); | |||||
#endif | |||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
wstring_convert(_Codecvt* __pcvt, state_type __state); | wstring_convert(_Codecvt* __pcvt, state_type __state); | ||||
_LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err, | _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err, | ||||
const wide_string& __wide_err = wide_string()); | const wide_string& __wide_err = wide_string()); | ||||
#ifndef _LIBCPP_CXX03_LANG | #ifndef _LIBCPP_CXX03_LANG | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
wstring_convert(wstring_convert&& __wc); | wstring_convert(wstring_convert&& __wc); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | private: | ||||
state_type __st_; | state_type __st_; | ||||
ios_base::openmode __cm_; | ios_base::openmode __cm_; | ||||
bool __owns_eb_; | bool __owns_eb_; | ||||
bool __owns_ib_; | bool __owns_ib_; | ||||
bool __always_noconv_; | bool __always_noconv_; | ||||
wbuffer_convert(const wbuffer_convert&); | wbuffer_convert(const wbuffer_convert&); | ||||
wbuffer_convert& operator=(const wbuffer_convert&); | wbuffer_convert& operator=(const wbuffer_convert&); | ||||
public: | public: | ||||
_LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = nullptr, | #if _LIBCPP_STD_VER > 17 | ||||
_Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); | wbuffer_convert() : wbuffer_convert(nullptr) {} | ||||
explicit wbuffer_convert(streambuf* __bytebuf, | |||||
_Codecvt* __pcvt = new _Codecvt, | |||||
state_type __state = state_type()); | |||||
#else | |||||
_LIBCPP_EXPLICIT_AFTER_CXX11 | |||||
wbuffer_convert(streambuf* __bytebuf = nullptr, | |||||
_Codecvt* __pcvt = new _Codecvt, | |||||
state_type __state = state_type()); | |||||
#endif | |||||
~wbuffer_convert(); | ~wbuffer_convert(); | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
streambuf* rdbuf() const {return __bufptr_;} | streambuf* rdbuf() const {return __bufptr_;} | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
streambuf* rdbuf(streambuf* __bytebuf) | streambuf* rdbuf(streambuf* __bytebuf) | ||||
{ | { | ||||
streambuf* __r = __bufptr_; | streambuf* __r = __bufptr_; | ||||
▲ Show 20 Lines • Show All 418 Lines • Show Last 20 Lines |