]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/filesystem/example/tchar.cpp
1 // Example use of Microsoft TCHAR ----------------------------------------------------//
3 // Copyright Beman Dawes 2008
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 #include <boost/filesystem/path.hpp>
9 #include <boost/filesystem/operations.hpp>
15 namespace fs
= boost::filesystem
;
17 typedef std::basic_string
<TCHAR
> tstring
;
19 void func( const fs::path
& p
)
21 assert( fs::exists( p
) );
26 // get a path that is known to exist
27 fs::path cp
= fs::current_path();
29 // demo: get tstring from the path
30 tstring cp_as_tstring
= cp
.string
<tstring
>();
32 // demo: pass tstring to filesystem function taking path
33 assert( fs::exists( cp_as_tstring
) );
35 // demo: pass tstring to user function taking path
36 func( cp_as_tstring
);