Platform

Engine/source/platform/platform.h

More...

Classes:

Namespaces:

namespace

Public Enumerations

enum
ALERT_ASSERT_RESULT {
  ALERT_ASSERT_DEBUG 
  ALERT_ASSERT_IGNORE 
  ALERT_ASSERT_IGNORE_ALL 
  ALERT_ASSERT_EXIT 
}

Public Functions

Add a new keyboard exclusion.

AlertAssert(const char * windowTitle, const char * message)
AlertOK(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.

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.

bool
deleteDirectory(const char * pPath)
bool
bool
dumpDirectories(const char * path, Vector< StringTableEntry > & directoryVector, S32 depth, bool noBasePath)
bool
dumpPath(const char * in_pBasePath, Vector< FileInfo > & out_rFileVector, S32 recurseDepth)
bool
bool
fileDelete(const char * name)
bool
fileTimeToString(FileTime * time, char * string, U32 strLen)
forceShutdown(S32 returnValue)

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)

Returns the full path to the directory that contains main.tscript.

Returns the milliseconds since the system was started.

Gets the time in seconds since the Epoch.

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
bool
isFile(const char * pFilePath)
bool
isFullPath(const char * path)
bool
isSubDirectory(const char * pParent, const char * pDir)

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)
messageBox(const UTF8 * title, const UTF8 * message, MBButtons buttons, MBIcons icon)
openFile(const char * path)
openFolder(const char * path)
bool
openWebBrowser(const char * webAddress)

Spawn the User default web browser with a URL.

outputDebugString(const char * string, ... )
bool
setClipboard(const char * text)
bool
setLoginPassword(const char * password)
setMainDotCsDir(const char * dir)

Set main.tscript directory. Used in runEntryScript()

setWindowLocked(bool locked)
setWindowSize(U32 newWidth, U32 newHeight, bool fullScreen)
sleep(U32 ms)

Asks the operating system to put the process to sleep for at least ms milliseconds.

bool
stringToFileTime(const char * string, FileTime * time)
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.

In this case, system start time. Storing milliseconds in a U32 overflows every 49.71 days

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

return:

true if browser successfully spawned

--------------------------------- Spawn the default Operating System web browser with a URL Parameters:
webAddress

URL to pass to browser

return:

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.