]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/quickbook/src/path.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / quickbook / src / path.hpp
1 /*=============================================================================
2 Copyright (c) 2002 2004 2006 Joel de Guzman
3 Copyright (c) 2004 Eric Niebler
4 Copyright (c) 2005 Thomas Guest
5 Copyright (c) 2013, 2017 Daniel James
6
7 Use, modification and distribution is subject to the Boost Software
8 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 http://www.boost.org/LICENSE_1_0.txt)
10 =============================================================================*/
11
12 #if !defined(BOOST_QUICKBOOK_DETAIL_PATH_HPP)
13 #define BOOST_QUICKBOOK_DETAIL_PATH_HPP
14
15 #include <boost/filesystem/path.hpp>
16 #include "native_text.hpp"
17
18 namespace quickbook
19 {
20 namespace fs = boost::filesystem;
21
22 // The relative path from base to path
23 fs::path path_difference(fs::path const& base, fs::path const& path, bool is_file = false);
24
25 // Convert a Boost.Filesystem path to a URL.
26 std::string file_path_to_url(fs::path const&);
27 std::string dir_path_to_url(fs::path const&);
28
29 namespace detail {
30 // 'generic': Paths in quickbook source and the generated boostbook.
31 // Always UTF-8.
32 // 'command_line':
33 // Paths (or other parameters) from the command line and
34 // possibly other sources in the future. Wide strings on
35 // normal windows, UTF-8 for cygwin and other platforms
36 // (hopefully).
37 // 'path': Stored as a boost::filesystem::path. Since
38 // Boost.Filesystem doesn't support cygwin, this
39 // is always wide on windows. UTF-8 on other
40 // platforms (again, hopefully).
41
42 #if QUICKBOOK_WIDE_PATHS
43 typedef std::wstring command_line_string;
44 #else
45 typedef std::string command_line_string;
46 #endif
47
48 std::string command_line_to_utf8(command_line_string const&);
49 fs::path command_line_to_path(command_line_string const&);
50
51 std::string path_to_generic(fs::path const&);
52 fs::path generic_to_path(quickbook::string_view);
53
54 stream_string path_to_stream(fs::path const& path);
55 }
56 }
57
58 #endif