1 | /* $Id: rtpath-expand-template.cpp.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - RTPath - Internal header that includes RTPATH_TEMPLATE_CPP_H multiple
|
---|
4 | * times to expand the code for different path styles.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox base platform packages, as
|
---|
11 | * available from https://www.virtualbox.org.
|
---|
12 | *
|
---|
13 | * This program is free software; you can redistribute it and/or
|
---|
14 | * modify it under the terms of the GNU General Public License
|
---|
15 | * as published by the Free Software Foundation, in version 3 of the
|
---|
16 | * License.
|
---|
17 | *
|
---|
18 | * This program is distributed in the hope that it will be useful, but
|
---|
19 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | * General Public License for more details.
|
---|
22 | *
|
---|
23 | * You should have received a copy of the GNU General Public License
|
---|
24 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 | *
|
---|
26 | * The contents of this file may alternatively be used under the terms
|
---|
27 | * of the Common Development and Distribution License Version 1.0
|
---|
28 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
29 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
30 | * CDDL are applicable instead of those of the GPL.
|
---|
31 | *
|
---|
32 | * You may elect to license modified versions of this file under the
|
---|
33 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
34 | *
|
---|
35 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
36 | */
|
---|
37 |
|
---|
38 | #undef RTPATH_DELIMITER
|
---|
39 |
|
---|
40 | /*
|
---|
41 | * DOS style
|
---|
42 | */
|
---|
43 | #undef RTPATH_STYLE
|
---|
44 | #undef RTPATH_SLASH
|
---|
45 | #undef RTPATH_SLASH_STR
|
---|
46 | #undef RTPATH_IS_SLASH
|
---|
47 | #undef RTPATH_IS_VOLSEP
|
---|
48 | #undef RTPATH_STYLE_FN
|
---|
49 |
|
---|
50 | #define RTPATH_STYLE RTPATH_STR_F_STYLE_DOS
|
---|
51 | #define RTPATH_SLASH '\\'
|
---|
52 | #define RTPATH_SLASH_STR "\\"
|
---|
53 | #define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '\\' || (a_ch) == '/' )
|
---|
54 | #define RTPATH_IS_VOLSEP(a_ch) ( (a_ch) == ':' )
|
---|
55 | #define RTPATH_STYLE_FN(a_Name) a_Name ## StyleDos
|
---|
56 | #include RTPATH_TEMPLATE_CPP_H
|
---|
57 |
|
---|
58 | /*
|
---|
59 | * Unix style.
|
---|
60 | */
|
---|
61 | #undef RTPATH_STYLE
|
---|
62 | #undef RTPATH_SLASH
|
---|
63 | #undef RTPATH_SLASH_STR
|
---|
64 | #undef RTPATH_IS_SLASH
|
---|
65 | #undef RTPATH_IS_VOLSEP
|
---|
66 | #undef RTPATH_STYLE_FN
|
---|
67 |
|
---|
68 | #define RTPATH_STYLE RTPATH_STR_F_STYLE_UNIX
|
---|
69 | #define RTPATH_SLASH '/'
|
---|
70 | #define RTPATH_SLASH_STR "/"
|
---|
71 | #define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '/' )
|
---|
72 | #define RTPATH_IS_VOLSEP(a_ch) ( false )
|
---|
73 | #define RTPATH_STYLE_FN(a_Name) a_Name ## StyleUnix
|
---|
74 | #include RTPATH_TEMPLATE_CPP_H
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Clean up and restore the host style.
|
---|
78 | */
|
---|
79 | #undef RTPATH_STYLE_FN
|
---|
80 | #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
|
---|
81 | # undef RTPATH_STYLE
|
---|
82 | # undef RTPATH_SLASH
|
---|
83 | # undef RTPATH_SLASH_STR
|
---|
84 | # undef RTPATH_IS_SLASH
|
---|
85 | # undef RTPATH_IS_VOLSEP
|
---|
86 | # define RTPATH_STYLE RTPATH_STR_F_STYLE_DOS
|
---|
87 | # define RTPATH_SLASH '\\'
|
---|
88 | # define RTPATH_SLASH_STR "\\"
|
---|
89 | # define RTPATH_IS_SLASH(a_ch) ( (a_ch) == '\\' || (a_ch) == '/' )
|
---|
90 | # define RTPATH_IS_VOLSEP(a_ch) ( (a_ch) == ':' )
|
---|
91 | #endif
|
---|
92 |
|
---|