2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/locale.hpp>
15 using namespace boost::locale
;
17 int main(int argc
,char **argv
)
20 std::cerr
<< "Usage backend locale" << std::endl
;
23 /// Set global locale to requested
25 /// Create a set that includes all strings sorted according to ABC order
26 /// std::locale can be used as object for comparison
27 std::vector
<std::string
> all
;
28 typedef std::set
<std::string
,std::locale
> set_type
;
31 /// Read all strings into the set
39 boost::locale::localization_backend_manager mgr
= boost::locale::localization_backend_manager::global();
42 std::locale::global(gen(argv
[2]));
43 for(int i
=0;i
<10000;i
++) {
44 for(unsigned j
=0;j
<all
.size();j
++) {
45 boost::locale::to_upper(all
[j
]);
46 boost::locale::to_lower(all
[j
]);
48 std::cout
<< boost::locale::to_upper(all
[j
]) << std::endl
;
49 std::cout
<< boost::locale::to_lower(all
[j
]) << std::endl
;
56 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4