diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/restricted/boost/libs/locale/src/std/codecvt.cpp | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/restricted/boost/libs/locale/src/std/codecvt.cpp')
-rw-r--r-- | contrib/restricted/boost/libs/locale/src/std/codecvt.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/restricted/boost/libs/locale/src/std/codecvt.cpp b/contrib/restricted/boost/libs/locale/src/std/codecvt.cpp new file mode 100644 index 0000000000..9b62d2f4f6 --- /dev/null +++ b/contrib/restricted/boost/libs/locale/src/std/codecvt.cpp @@ -0,0 +1,55 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +#define BOOST_LOCALE_SOURCE +#include <locale> +#include <boost/cstdint.hpp> +#include <boost/locale/util.hpp> +#include "all_generator.hpp" +#include <vector> +namespace boost { +namespace locale { +namespace impl_std { + template<typename CharType> + std::locale codecvt_bychar( std::locale const &in, + std::string const &locale_name) + { + return std::locale(in,new std::codecvt_byname<CharType,char,std::mbstate_t>(locale_name.c_str())); + } + + + std::locale create_codecvt( std::locale const &in, + std::string const &locale_name, + character_facet_type type, + utf8_support utf) + { + if(utf == utf8_from_wide) { + return util::create_utf8_codecvt(in,type); + } + switch(type) { + case char_facet: + return codecvt_bychar<char>(in,locale_name); + case wchar_t_facet: + return codecvt_bychar<wchar_t>(in,locale_name); + #if defined(BOOST_LOCALE_ENABLE_CHAR16_T) && !defined(BOOST_NO_CHAR16_T_CODECVT) + case char16_t_facet: + return codecvt_bychar<char16_t>(in,locale_name); + #endif + #if defined(BOOST_LOCALE_ENABLE_CHAR32_T) && !defined(BOOST_NO_CHAR32_T_CODECVT) + case char32_t_facet: + return codecvt_bychar<char32_t>(in,locale_name); + #endif + default: + return in; + } + } + +} // impl_std +} // locale +} // boost + +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 |