]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/locale/examples/hello.cpp
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)
8 #include <boost/locale.hpp>
15 using namespace boost::locale
;
19 // Create system default locale
22 // Make it system global
25 // Set as default locale for output
27 cout
<<format("Today {1,date} at {1,time} we had run our first localization example") % time(0)
30 cout
<<"This is how we show numbers in this locale "<<as::number
<< 103.34 <<endl
;
31 cout
<<"This is how we show currency in this locale "<<as::currency
<< 103.34 <<endl
;
32 cout
<<"This is typical date in the locale "<<as::date
<< std::time(0) <<endl
;
33 cout
<<"This is typical time in the locale "<<as::time
<< std::time(0) <<endl
;
34 cout
<<"This is upper case "<<to_upper("Hello World!")<<endl
;
35 cout
<<"This is lower case "<<to_lower("Hello World!")<<endl
;
36 cout
<<"This is title case "<<to_title("Hello World!")<<endl
;
37 cout
<<"This is fold case "<<fold_case("Hello World!")<<endl
;
41 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4