-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPath.h
More file actions
20 lines (18 loc) · 895 Bytes
/
Copy pathPath.h
File metadata and controls
20 lines (18 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include <string>
namespace Path
{
// Returns the filename from a path string.
// Excludes the file extension if "getExt" is false.
#ifdef _WIN32
const std::string Filename(const std::string& path, const bool getExt = true, const char delim = '\\');
#else
const std::string Filename(const std::string& path, const bool getExt = true, const char delim = '/');
#endif
// Returns the file extension from a path string.
// Excludes "delim" if "getDot" is false.
const std::string Extension(const std::string& path, const bool getDot = true, const char delim = '.');
// Returns the parent directory of a directory or file, and cuts "cut" directories.
// Excludes suffix "delim" (e.g C:\folder\file = C:\folder) if "addSuffix" is false.
const std::string Directory(const std::string& path, const uint32_t cutDir = 0, const bool addSuffix = true, const char delim = '\\');
}