Platform
Engine/source/platform/platform.h
Classes:
Description of a keyboard input we want to ignore.
Namespaces:
Public Enumerations
ALERT_ASSERT_RESULT { ALERT_ASSERT_DEBUG ALERT_ASSERT_IGNORE ALERT_ASSERT_IGNORE_ALL ALERT_ASSERT_EXIT }
Public Variables
Public Functions
addExcludedDirectory(const char * pDir)
Add a new keyboard exclusion.
advanceTime(U32 delta)
AlertAssert(const char * windowTitle, const char * message)
bool
AlertOKCancel(const char * windowTitle, const char * message)
bool
AlertRetry(const char * windowTitle, const char * message)
bool
cdFileExists(const char * filePath, const char * volumeName, S32 serialNum)
const bool
Check if a given input event should be excluded.
bool
checkOtherInstances(const char * string)
just check if the app's global mutex exists, and if so, return true - otherwise, false.
Reset the keyboard input exclusion list.
bool
compareFileTimes(const FileTime & a, const FileTime & b)
compare file times returns < 0 if a is earlier than b, >0 if b is earlier than a
compareModifiedTimes(const char * firstPath, const char * secondPath)
Compares the last modified time between two file paths.
bool
createPath(const char * path)
Given a directory path, create all necessary directories for that path to exist.
createPlatformFriendlyFilename(const char * filename)
bool
deleteDirectory(const char * pPath)
bool
displaySplashWindow(String path)
bool
bool
dumpDirectories(const char * path, Vector< StringTableEntry > & directoryVector, S32 depth, bool noBasePath)
bool
excludeOtherInstances(const char * string)
bool
fileDelete(const char * name)
bool
fileTimeToString(FileTime * time, char * string, U32 strLen)
fileToLocalTime(const FileTime & ft, LocalTime * lt)
forceShutdown(S32 returnValue)
const char *
Returns the filename of the torque executable.
Returns full pathname of the torque executable without filename.
getFileSize(const char * pFilePath)
bool
getFileTimes(const char * filePath, FileTime * createTime, FileTime * modifyTime)
const char *
Returns the full path to the directory that contains main.tscript.
getPrefsPath(const char * file)
Returns the milliseconds since the system was started.
bool
getVolumeInformationList(Vector< VolumeInformation > & out_rVolumeInfoVector, bool bOnlyFixedDrives)
getVolumeNamesList(Vector< const char * > & out_rNameVector, bool bOnlyFixedDrives)
bool
Set/Get whether this is a web deployment.
bool
hasSubDirectory(const char * pPath)
bool
isDirectory(const char * pDirPath)
bool
isExcludedDirectory(const char * pDir)
bool
isFullPath(const char * path)
bool
isSubDirectory(const char * pParent, const char * pDir)
localTimeToString(const LocalTime & lt)
Converts the local time to a formatted string appropriate for the current platform.
char *
makeFullPathName(const char * path, char * buffer, U32 size, const char * cwd)
makeRelativePathName(const char * path, const char * to)
openFolder(const char * path)
bool
openWebBrowser(const char * webAddress)
Spawn the User default web browser with a URL.
outputDebugString(const char * string, ... )
postQuitMessage(const S32 in_quitVal)
bool
setClipboard(const char * text)
bool
setCurrentDirectory(StringTableEntry newDir)
bool
setLoginPassword(const char * password)
setMainDotCsDir(const char * dir)
Set main.tscript directory. Used in runEntryScript()
setMathControlState(U32 state)
setWebDeployment(bool v)
setWindowLocked(bool locked)
setWindowSize(U32 newWidth, U32 newHeight, bool fullScreen)
bool
stringToFileTime(const char * string, FileTime * time)
stripBasePath(const char * path)
stripExtension(String fileName, Vector< String > & validExtensions)
Return "fileName" stripped of its extension.
Detailed Description
Public Enumerations
ALERT_ASSERT_RESULT
Enumerator
- ALERT_ASSERT_DEBUG
- ALERT_ASSERT_IGNORE
- ALERT_ASSERT_IGNORE_ALL
- ALERT_ASSERT_EXIT
Public Variables
struct VolumeInformation * PVolumeInformation
SystemInfo_struct SystemInfo
Signal< void(void)> SystemInfoReady
Public Functions
addExcludedDirectory(const char * pDir)
addKeyboardInputExclusion(const KeyboardInputExclusion & kie)
Add a new keyboard exclusion.
advanceTime(U32 delta)
AlertAssert(const char * windowTitle, const char * message)
AlertOK(const char * windowTitle, const char * message)
AlertOKCancel(const char * windowTitle, const char * message)
AlertRetry(const char * windowTitle, const char * message)
cdFileExists(const char * filePath, const char * volumeName, S32 serialNum)
checkKeyboardInputExclusion(const InputEventInfo * info)
Check if a given input event should be excluded.
checkOtherInstances(const char * string)
just check if the app's global mutex exists, and if so, return true - otherwise, false.
Should be called before ExcludeOther at very start of app execution.
clearExcludedDirectories()
clearKeyboardInputExclusion()
Reset the keyboard input exclusion list.
closeSplashWindow()
closeWindow()
compareFileTimes(const FileTime & a, const FileTime & b)
compare file times returns < 0 if a is earlier than b, >0 if b is earlier than a
compareModifiedTimes(const char * firstPath, const char * secondPath)
Compares the last modified time between two file paths.
Returns < 0 if the first file is earlier than the second, > 0 if the second file is earlier than the first, and 0 if the files are equal.
If either of the files doesn't exist it returns -1.
createPath(const char * path)
Given a directory path, create all necessary directories for that path to exist.
createPlatformFriendlyFilename(const char * filename)
debugBreak()
deleteDirectory(const char * pPath)
displaySplashWindow(String path)
doCDCheck()
dumpDirectories(const char * path, Vector< StringTableEntry > & directoryVector, S32 depth, bool noBasePath)
dumpPath(const char * in_pBasePath, Vector< FileInfo > & out_rFileVector, S32 recurseDepth)
excludeOtherInstances(const char * string)
fileDelete(const char * name)
fileTimeToString(FileTime * time, char * string, U32 strLen)
fileToLocalTime(const FileTime & ft, LocalTime * lt)
forceShutdown(S32 returnValue)
getBackgroundSleepTime()
getClipboard()
getCurrentDirectory()
getExecutableName()
Returns the filename of the torque executable.
On Win32, this is the .exe file. On Mac, this is the .app/ directory bundle.
getExecutablePath()
Returns full pathname of the torque executable without filename.
Finds and sets the current working directory.
Torque tries to automatically detect whether you have placed the game files inside or outside the application's bundle. It checks for the presence of the file 'main.cs'. If it finds it, Torque will assume that the other game files are there too. If Torque does not see 'main.cs' inside its bundle, it will assume the files are outside the bundle. Since you probably don't want to copy the game files into the app every time you build, you will want to leave them outside the bundle for development.
Placing all content inside the application bundle gives a much better user experience when you distribute your app.
getFileSize(const char * pFilePath)
getFileTimes(const char * filePath, FileTime * createTime, FileTime * modifyTime)
getLocalTime(LocalTime & )
getLoginPassword()
getMainDotCsDir()
Returns the full path to the directory that contains main.tscript.
Tools scripts are validated as such if they are in this directory or a subdirectory of this directory.
getMathControlState()
getPrefsPath(const char * file)
getRandom()
getRealMilliseconds()
Returns the milliseconds since the system was started.
Gets the time in milliseconds since some epoch.
You should not depend on this for high precision timing.
getTemporaryDirectory()
getTemporaryFileName()
getTime()
Gets the time in seconds since the Epoch.
getUserDataDirectory()
getUserHomeDirectory()
getUserIsAdministrator()
getVirtualMilliseconds()
getVolumeInformationList(Vector< VolumeInformation > & out_rVolumeInfoVector, bool bOnlyFixedDrives)
getVolumeNamesList(Vector< const char * > & out_rNameVector, bool bOnlyFixedDrives)
getWebDeployment()
Set/Get whether this is a web deployment.
hasSubDirectory(const char * pPath)
init()
initConsole()
isDirectory(const char * pDirPath)
isExcludedDirectory(const char * pDir)
isFile(const char * pFilePath)
isFullPath(const char * path)
isSubDirectory(const char * pParent, const char * pDir)
localTimeToString(const LocalTime & lt)
Converts the local time to a formatted string appropriate for the current platform.
makeFullPathName(const char * path, char * buffer, U32 size, const char * cwd)
makeRelativePathName(const char * path, const char * to)
messageBox(const UTF8 * title, const UTF8 * message, MBButtons buttons, MBIcons icon)
minimizeWindow()
openFile(const char * path)
openFolder(const char * path)
openWebBrowser(const char * webAddress)
Spawn the User default web browser with a URL.
Parameters:
webAddress | URL to pass to browser |
true if browser successfully spawned
webAddress | URL to pass to browser |
true if browser successfully spawned
outputDebugString(const char * string, ... )
postQuitMessage(const S32 in_quitVal)
process()
restartInstance()
setClipboard(const char * text)
setCurrentDirectory(StringTableEntry newDir)
setLoginPassword(const char * password)
setMainDotCsDir(const char * dir)
Set main.tscript directory. Used in runEntryScript()
setMathControlState(U32 state)
setMathControlStateKnown()
setWebDeployment(bool v)
setWindowLocked(bool locked)
setWindowSize(U32 newWidth, U32 newHeight, bool fullScreen)
shutdown()
sleep(U32 ms)
Asks the operating system to put the process to sleep for at least ms milliseconds.
stringToFileTime(const char * string, FileTime * time)
stripBasePath(const char * path)
stripExtension(String fileName, Vector< String > & validExtensions)
Return "fileName" stripped of its extension.
Only extensions contained in "validExtensions" will be stripped from the filename.
note:Extensions in "validExtension" should include the dot.