MCPcopy Create free account
hub / github.com/boostorg/filesystem / main

Function main

example/tut5.cpp:16–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace fs = boost::filesystem;
15
16int main()
17{
18 // \u263A is "Unicode WHITE SMILING FACE = have a nice day!"
19 std::string narrow_string("smile2");
20 std::wstring wide_string(L"smile2\u263A");
21 std::list< char > narrow_list;
22 narrow_list.push_back('s');
23 narrow_list.push_back('m');
24 narrow_list.push_back('i');
25 narrow_list.push_back('l');
26 narrow_list.push_back('e');
27 narrow_list.push_back('3');
28 std::list< wchar_t > wide_list;
29 wide_list.push_back(L's');
30 wide_list.push_back(L'm');
31 wide_list.push_back(L'i');
32 wide_list.push_back(L'l');
33 wide_list.push_back(L'e');
34 wide_list.push_back(L'3');
35 wide_list.push_back(L'\u263A');
36
37 {
38 fs::ofstream f("smile");
39 }
40 {
41 fs::ofstream f(L"smile\u263A");
42 }
43 {
44 fs::ofstream f(narrow_string);
45 }
46 {
47 fs::ofstream f(wide_string);
48 }
49 {
50 fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end()));
51 }
52 {
53 fs::ofstream f(fs::path(wide_list.begin(), wide_list.end()));
54 }
55 narrow_list.pop_back();
56 narrow_list.push_back('4');
57 wide_list.pop_back();
58 wide_list.pop_back();
59 wide_list.push_back(L'4');
60 wide_list.push_back(L'\u263A');
61 {
62 fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end()));
63 }
64 {
65 fs::ofstream f(fs::path(wide_list.begin(), wide_list.end()));
66 }
67
68 return 0;
69}

Callers

nothing calls this directly

Calls 3

pathFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected