TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_platform_utilities.hpp
1 
9 #ifndef TurtleBrains_Utilities_hpp
10 #define TurtleBrains_Utilities_hpp
11 
12 #include <turtle_brains/core/tb_string.hpp>
13 
14 #include <vector>
15 
16 namespace TurtleBrains::Core::PlatformUtilities
17 {
21  void Sleep(const tbCore::uint32 milliseconds);
22 
30  String UserDirectoryPath(void);
31 
37  bool CreateDirectoryPath(const String& pathToDirectory);
38 
42  void RemoveFileOrDirectory(const String& pathToRemove);
43 
44  bool RenameFileOrDirectory(const String& oldPath, const String& newPath);
45 
47  bool IsDirectory(const String& pathToDirectory);
48 
57  String GetDirectory(const String& pathToFile);
58 
63  String GetFileName(const String& pathToFile, const bool includeExtension);
64 
68  String GetFileExtension(const String& pathToFile);
69 
76  String GetCurrentWorkingDirectory(void);
77 
81  void SetCurrentWorkingDirectory(const String& pathToDirectory);
82 
86  bool DoesFileExist(const String& pathToFile);
87 
91  bool DoesDirectoryExist(const String& pathToDirectory);
92 
96  void GetContentsOfDirectory(const String& pathToDirectory, std::vector<String>& contents);
97 
105  String PathToSystemSlashes(const String& path);
106  String& PathToSystemSlashes(String& path);
107 
114  String PathToNormalSlashes(const String& path);
115  String& PathToNormalSlashes(String& path);
116 
120  bool IsNormalSlashes(const String& path);
121 
125  void OpenBrowserTo(const String& uri);
126 
127 }; /* namespace TurtleBrains::Core::PlatformUtilities */
128 
129 namespace tbCore = TurtleBrains::Core;
130 
131 #endif /* TurtleBrains_Utilities_hpp */
Contains core functionality for each component of the API.
Definition: tb_debug_logger.hpp:125
std::string String
Definition: tb_string.hpp:302
std::uint32_t uint32
Unsigned integer with a size of 32 bits. Supports values from 0 to 4294967295, (2^32 - 1).
Definition: tb_types.hpp:27