1 | /* Copyright (c) 2004 CrystalClear Software, Inc. |
2 | * Use, modification and distribution is subject to the |
3 | * Boost Software License, Version 1.0. (See accompanying |
4 | * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
5 | * Author: Jeff Garland |
6 | * $Date$ |
7 | * |
8 | * This file isn't part of the official regression test suite at |
9 | * the moment, but it is a basic test of the strings_from_facet.hpp |
10 | * infrastructure that can be compiled trivially. |
11 | */ |
12 | |
13 | |
14 | #include <string> |
15 | #include <iostream> |
16 | #include <sstream> |
17 | #include <vector> |
18 | #include <fstream> |
19 | |
20 | #include "boost/date_time/strings_from_facet.hpp" |
21 | #include "algorithm_ext/container_print.hpp" |
22 | |
23 | |
24 | |
25 | int |
26 | main() |
27 | { |
28 | using boost::date_time::gather_month_strings; |
29 | using boost::date_time::gather_weekday_strings; |
30 | |
31 | std::vector<std::string> data; |
32 | std::vector<std::wstring> wdata; |
33 | |
34 | data = gather_month_strings<char>(std::locale::classic()); |
35 | print(data, std::cout); |
36 | data = gather_month_strings<char>(std::locale::classic(), false); |
37 | print(data, std::cout); |
38 | data = gather_weekday_strings<char>(std::locale::classic()); |
39 | print(data, std::cout); |
40 | data = gather_weekday_strings<char>(std::locale::classic(), false); |
41 | print(data, std::cout); |
42 | |
43 | wdata = gather_month_strings<wchar_t>(std::locale::classic()); |
44 | std::wofstream wof("from_facet_test.out" ); |
45 | int i=0; |
46 | while (i < wdata.size()) { |
47 | wof << wdata[i] << std::endl; |
48 | i++; |
49 | } |
50 | } |
51 | |