Apache Mesos
constants.hpp
Go to the documentation of this file.
1 // Licensed under the Apache License, Version 2.0 (the "License");
2 // you may not use this file except in compliance with the License.
3 // You may obtain a copy of the License at
4 //
5 // http://www.apache.org/licenses/LICENSE-2.0
6 //
7 // Unless required by applicable law or agreed to in writing, software
8 // distributed under the License is distributed on an "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 // See the License for the specific language governing permissions and
11 // limitations under the License.
12 
13 #ifndef __STOUT_OS_CONSTANTS_HPP__
14 #define __STOUT_OS_CONSTANTS_HPP__
15 
16 #include <string>
17 
18 namespace os {
19 
20 constexpr char WINDOWS_PATH_SEPARATOR = '\\';
21 constexpr char POSIX_PATH_SEPARATOR = '/';
22 
23 #ifndef __WINDOWS__
25 #else
26 constexpr char PATH_SEPARATOR = WINDOWS_PATH_SEPARATOR;
27 #endif // __WINDOWS__
28 
29 #ifndef __WINDOWS__
30 constexpr char DEV_NULL[] = "/dev/null";
31 #else
32 constexpr char DEV_NULL[] = "NUL";
33 #endif // __WINDOWS__
34 
35 #ifdef __WINDOWS__
36 // This prefix is prepended to absolute paths on Windows to indicate the path
37 // may be greater than 255 characters.
38 //
39 // NOTE: We do not use a R"raw string" here because syntax highlighters do not
40 // handle mismatched backslashes well.
41 constexpr char LONGPATH_PREFIX[] = "\\\\?\\";
42 #endif // __WINDOWS__
43 
44 } // namespace os {
45 
46 #endif // __STOUT_OS_CONSTANTS_HPP__
constexpr char WINDOWS_PATH_SEPARATOR
Definition: constants.hpp:20
constexpr char POSIX_PATH_SEPARATOR
Definition: constants.hpp:21
Definition: posix_signalhandler.hpp:23
constexpr char DEV_NULL[]
Definition: constants.hpp:30
constexpr char PATH_SEPARATOR
Definition: constants.hpp:24