C++ SDK for MANUS Core 2.0
Loading...
Searching...
No Matches
ClientPlatformSpecific.hpp
Go to the documentation of this file.
1#ifndef _CLIENT_PLATFORM_SPECIFIC_HPP_
2#define _CLIENT_PLATFORM_SPECIFIC_HPP_
3
4#include "ClientPlatformSpecificTypes.hpp"
5
6#include "ManusSDKTypes.h"
7
8// size_t
9#include <cstddef>
10// std::string
11#include <string>
12
13// Set up a Doxygen group.
19{
20protected:
23
25 bool PlatformSpecificShutdown(void);
26
28 void UpdateInput(void);
29
31 static bool CopyString(
32 char* const p_Target,
33 const size_t p_MaxLengthThatWillFitInTarget,
34 const std::string& p_Source);
35
41 bool ResizeWindow(
42 const short int p_ConsoleWidth,
43 const short int p_ConsoleHeight,
44 const short int p_ConsoleScrollback);
45
50 const int p_ConsoleCurrentOffset);
51
53 static void ClearConsole(void);
54
57 bool GetKey(const int p_Key);
58
60 bool GetKeyDown(const int p_Key);
61
63 bool GetKeyUp(const int p_Key);
64
67 std::string GetDocumentsDirectoryPath_UTF8(void);
68
71 std::ifstream GetInputFileStream(std::string p_Path_UTF8);
72
75 std::ofstream GetOutputFileStream(std::string p_Path_UTF8);
76
79 bool DoesFolderOrFileExist(std::string p_Path_UTF8);
80
83 void CreateFolderIfItDoesNotExist(std::string p_Path_UTF8);
84
86 static const std::string s_SlashForFilesystemPath;
87};
88
89// Close the Doxygen group.
92#endif
void ApplyConsolePosition(const int p_ConsoleCurrentOffset)
Set the current console position. This handles the platform-specific part of advancing the console po...
static void ClearConsole(void)
Clear the console window.
void UpdateInput(void)
Update the current keyboard state.
bool PlatformSpecificInitialization(void)
Initialise things only needed for this platform.
bool GetKeyDown(const int p_Key)
Returns true first time it is called when key is pressed.
bool GetKeyUp(const int p_Key)
Returns true first time it is called when key is released.
static bool CopyString(char *const p_Target, const size_t p_MaxLengthThatWillFitInTarget, const std::string &p_Source)
Copy the given string into the given target.
bool ResizeWindow(const short int p_ConsoleWidth, const short int p_ConsoleHeight, const short int p_ConsoleScrollback)
Resize the window, so the log messages will fit. Make sure not to enter illegal sizes in here or SetC...
bool DoesFolderOrFileExist(std::string p_Path_UTF8)
Check if the given folder or file exists. The folder path given should be in UTF-8 format.
bool PlatformSpecificShutdown(void)
Shut down things only needed for this platform.
bool GetKey(const int p_Key)
Gets key's current state. True is pressed false is not pressed.
std::ofstream GetOutputFileStream(std::string p_Path_UTF8)
Get an output stream for the given file. The file's path should be in UTF-8 format.
std::string GetDocumentsDirectoryPath_UTF8(void)
Get the path to the user's Documents folder. The string should be in UTF-8 format.
void CreateFolderIfItDoesNotExist(std::string p_Path_UTF8)
Create the given folder if it does not exist. The folder path given should be in UTF-8 format.
static const std::string s_SlashForFilesystemPath
The slash character that is used in the filesystem.
std::ifstream GetInputFileStream(std::string p_Path_UTF8)
Get an input stream for the given file. The file's path should be in UTF-8 format.