C++ Utilities 5.27.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
path.h File Reference
#include "../global.h"
#include <list>
#include <string>
#include <string_view>
Include dependency graph for path.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  CppUtilities
 Contains all utilities provides by the c++utilities library.
 

Macros

#define PATH_SEP_CHAR   '/'
 
#define SEARCH_PATH_SEP_CHAR   ':'
 
#define PATH_SEP_STR   "/"
 
#define SEARCH_PATH_SEP_STR   ":"
 

Typedefs

using CppUtilities::PathValueType
 The native type used by std::filesystem:path.
 
using CppUtilities::NativePathString = std::basic_string<PathValueType>
 The string type used to store paths in the native encoding.
 
using CppUtilities::NativePathStringView = std::basic_string_view<PathValueType>
 The string view type used to pass paths in the native encoding.
 
using CppUtilities::PathString = std::string
 The string type used to store paths UTF-8 encoded.
 
using CppUtilities::PathStringView = std::string_view
 The string view type used to pass paths UTF-8 encoded.
 

Functions

CPP_UTILITIES_EXPORT std::string CppUtilities::fileName (const std::string &path)
 Returns the file name and extension of the specified path string.
 
CPP_UTILITIES_EXPORT std::string CppUtilities::directory (const std::string &path)
 Returns the directory of the specified path string (including trailing slash).
 
CPP_UTILITIES_EXPORT void CppUtilities::removeInvalidChars (std::string &fileName)
 Removes invalid characters from the specified fileName.
 
NativePathStringView CppUtilities::makeNativePath (PathStringView path)
 Returns path in the platform's native encoding.
 
PathStringView CppUtilities::extractNativePath (NativePathStringView path)
 Returns path as UTF-8 string or string view.
 

Macro Definition Documentation

◆ PATH_SEP_CHAR

#define PATH_SEP_CHAR   '/'

Definition at line 23 of file path.h.

◆ PATH_SEP_STR

#define PATH_SEP_STR   "/"

Definition at line 25 of file path.h.

◆ SEARCH_PATH_SEP_CHAR

#define SEARCH_PATH_SEP_CHAR   ':'

Definition at line 24 of file path.h.

◆ SEARCH_PATH_SEP_STR

#define SEARCH_PATH_SEP_STR   ":"

Definition at line 26 of file path.h.