-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: added platform-dependent type aliases for char and string
Signed-off-by: k4yt3x <[email protected]>
- Loading branch information
Showing
7 changed files
with
126 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,41 @@ | ||
#ifndef FSUTILS_H | ||
#define FSUTILS_H | ||
|
||
#ifdef __cplusplus | ||
#include <filesystem> | ||
#endif | ||
|
||
#ifdef _WIN32 | ||
#ifdef UNICODE | ||
typedef wchar_t CharType; | ||
#define STR(x) L##x | ||
#else | ||
typedef char CharType; | ||
#define STR(x) x | ||
#endif | ||
#else | ||
typedef char CharType; | ||
#define STR(x) x | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
#include <string> | ||
#ifdef _WIN32 | ||
#ifdef UNICODE | ||
typedef std::wstring StringType; | ||
#else | ||
typedef std::string StringType; | ||
#endif | ||
#else | ||
typedef std::string StringType; | ||
#endif | ||
|
||
bool filepath_is_readable(const std::filesystem::path &path); | ||
|
||
std::filesystem::path find_resource_file(const std::filesystem::path &path); | ||
|
||
std::string path_to_string(const std::filesystem::path& path); | ||
std::string path_to_string(const std::filesystem::path &path); | ||
|
||
#endif // __cplusplus | ||
|
||
#endif // FSUTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.