Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Static Public Member Functions | List of all members
Platform Struct Reference

`#include <platform.h>`

## Classes
struct | FileInfo
struct | LocalTime
struct | VolumeInformation

## Public Types
enum | DFILE_STATUS { DFILE_OK = 1 }
typedef void * | FILE_HANDLE

## Static Public Member Functions
static void | init ()
| Application. More...
static void | initConsole ()
static void | process ()
static void | shutdown ()
static void | sleep (U32 ms)
| Asks the operating system to put the process to sleep for at least ms milliseconds. More...
static void | restartInstance ()
static void | postQuitMessage (const U32 in_quitVal)
static void | forceShutdown (S32 returnValue)
static StringTableEntry | getUserHomeDirectory ()
| User. More...
static StringTableEntry | getUserDataDirectory ()
static void | initWindow (const Point2I &initialSize, const char *name)
| Window. More...
static void | setWindowTitle (const char *title)
static void | setWindowSize (U32 newWidth, U32 newHeight)
static const Point2I & | getWindowSize ()
static void | minimizeWindow ()
static void | restoreWindow ()
static void | setMouseLock (bool locked)
static void | AlertOK (const char *windowTitle, const char *message)
| GUI. More...
static bool | AlertOKCancel (const char *windowTitle, const char *message)
static bool | AlertRetry (const char *windowTitle, const char *message)
static bool | AlertYesNo (const char *windowTitle, const char *message)
static S32 | messageBox (const UTF8 *title, const UTF8 *message, MBButtons buttons=MBOkCancel, MBIcons icon=MIInformation)
static void | enableKeyboardTranslation (void)
| Input. More...
static void | disableKeyboardTranslation (void)
static U32 | getTime (void)
| Date & Time. More...
static U32 | getVirtualMilliseconds (void)
static U32 | getRealMilliseconds (void)
static void | advanceTime (U32 delta)
static S32 | getBackgroundSleepTime ()
static void | getLocalTime (LocalTime &)
static S32 | compareFileTimes (const FileTime &a, const FileTime &b)
static float | getRandom ()
| Math. More...
static void | debugBreak ()
| Debug. More...
static void | outputDebugString (const char *string)
static void | cprintf (const char *str)
static StringTableEntry | getCurrentDirectory ()
| File IO. More...
static bool | setCurrentDirectory (StringTableEntry newDir)
static StringTableEntry | getTemporaryDirectory ()
static StringTableEntry | getTemporaryFileName ()
static StringTableEntry | getExecutableName ()
static StringTableEntry | getExecutablePath ()
static void | setMainDotCsDir (const char *dir)
static StringTableEntry | getMainDotCsDir ()
static StringTableEntry | getPrefsPath (const char *file=NULL)
static char * | makeFullPathName (const char *path, char *buffer, U32 size, const char *cwd=NULL)
static StringTableEntry | stripBasePath (const char *path)
static bool | isFullPath (const char *path)
static StringTableEntry | makeRelativePathName (const char *path, const char *to)
static bool | dumpPath (const char *in_pBasePath, Vector< FileInfo > &out_rFileVector, S32 recurseDepth=-1)
static bool | dumpDirectories (const char *path, Vector< StringTableEntry > &directoryVector, S32 depth=0, bool noBasePath=false)
static bool | hasSubDirectory (const char *pPath)
static bool | getFileTimes (const char *filePath, FileTime *createTime, FileTime *modifyTime)
static bool | isFile (const char *pFilePath)
static S32 | getFileSize (const char *pFilePath)
static bool | hasExtension (const char *pFilename, const char *pExtension)
static bool | isDirectory (const char *pDirPath)
static bool | isSubDirectory (const char *pParent, const char *pDir)
static void | addExcludedDirectory (const char *pDir)
static void | clearExcludedDirectories ()
static bool | isExcludedDirectory (const char *pDir)
static bool | createPath (const char *path)
static bool | deleteDirectory (const char *pPath)
static bool | fileDelete (const char *name)
static bool | fileRename (const char *oldName, const char *newName)
static bool | fileTouch (const char *name)
static bool | pathCopy (const char *fromName, const char *toName, bool nooverwrite=true)
static StringTableEntry | osGetTemporaryDirectory ()
static StringTableEntry | createUUID (void)
| Misc. More...
static bool | openWebBrowser (const char *webAddress)
static void | openFolder (const char *path)
static const char * | getClipboard ()
static bool | setClipboard (const char *text)

## Member Typedef Documentation

typedef void* FILE_HANDLE

## Member Enumeration Documentation

enum DFILE_STATUS

Enumerator
DFILE_OK |

## Member Function Documentation

addExcludedDirectory | ( | const char * | pDir | ) |
| static

Initial value:
{
Con::printf("testing %s",argv[1])
Con::printf
void printf(const char *fmt,...)
Definition: console.cc:636

void advanceTime | ( | U32 | delta | ) |
| static

void AlertOK | ( | const char * | windowTitle,
|  | const char * | message
| ) |  |
| static

GUI.

bool AlertOKCancel | ( | const char * | windowTitle,
|  | const char * | message
| ) |  |
| static

bool AlertRetry | ( | const char * | windowTitle,
|  | const char * | message
| ) |  |
| static

bool AlertYesNo | ( | const char * | windowTitle,
|  | const char * | message
| ) |  |
| static

void clearExcludedDirectories | ( |  | ) |
| static

S32 compareFileTimes | ( | const FileTime & | a,
|  | const FileTime & | b
| ) |  |
| static

void cprintf | ( | const char * | str | ) |
| static

bool createPath | ( | const char * | path | ) |
| static

StringTableEntry createUUID | ( | void |  | ) |
| static

Misc.

void debugBreak | ( |  | ) |
| static

Debug.

bool deleteDirectory | ( | const char * | pPath | ) |
| static

void disableKeyboardTranslation | ( | void |  | ) |
| static

bool dumpDirectories | ( | const char * | path,
|  | Vector< StringTableEntry > & | directoryVector,
|  | S32 | depth = `0`,
|  | bool | noBasePath = `false`
| ) |  |
| static

bool dumpPath | ( | const char * | in_pBasePath,
|  | Vector< FileInfo > & | out_rFileVector,
|  | S32 | recurseDepth = `-1`
| ) |  |
| static

void enableKeyboardTranslation | ( | void |  | ) |
| static

Input.

bool fileDelete | ( | const char * | name | ) |
| static

bool fileRename | ( | const char * | oldName,
|  | const char * | newName
| ) |  |
| static

static bool fileTouch | ( | const char * | name | ) |
| static

void forceShutdown | ( | S32 | returnValue | ) |
| static

S32 getBackgroundSleepTime | ( |  | ) |
| static

const char * getClipboard | ( |  | ) |
| static

StringTableEntry getCurrentDirectory | ( |  | ) |
| static

File IO.

StringTableEntry getExecutableName | ( |  | ) |
| static

StringTableEntry getExecutablePath | ( |  | ) |
| static

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.

Android reads all assets out of compressed bundle so we dont realy have an executable path

S32 getFileSize | ( | const char * | pFilePath | ) |
| static

bool getFileTimes | ( | const char * | filePath,
|  | FileTime * | createTime,
|  | FileTime * | modifyTime
| ) |  |
| static

void getLocalTime | ( | LocalTime & | lt | ) |
| static

Get time as long integer.

Convert to local time, thread safe.

Fill the return struct

StringTableEntry getMainDotCsDir | ( |  | ) |
| static

StringTableEntry getPrefsPath | ( | const char * | file = `NULL` | ) |
| static

F32 getRandom | ( |  | ) |
| static

Math.

U32 getRealMilliseconds | ( | void |  | ) |
| static

Gets the time in milliseconds since some epoch. In this case, system start time. Storing milisec in a U32 overflows every 49.71 days

StringTableEntry getTemporaryDirectory | ( |  | ) |
| static

StringTableEntry getTemporaryFileName | ( |  | ) |
| static

U32 getTime | ( | void |  | ) |
| static

Date & Time.

Gets the time in seconds since the Epoch.

const char * getUserDataDirectory | ( |  | ) |
| static

const char * getUserHomeDirectory | ( |  | ) |
| static

User.

U32 getVirtualMilliseconds | ( | void |  | ) |
| static

const Point2I & getWindowSize | ( |  | ) |
| static

bool hasExtension | ( | const char * | pFilename,
|  | const char * | pExtension
| ) |  |
| static

bool hasSubDirectory | ( | const char * | pPath | ) |
| static

void init | ( |  | ) |
| static

Application.

void initConsole | ( |  | ) |
| static

void initWindow | ( | const Point2I & | initialSize,
|  | const char * | name
| ) |  |
| static

Window.

bool isDirectory | ( | const char * | pDirPath | ) |
| static

bool isExcludedDirectory | ( | const char * | pDir | ) |
| static

bool isFile | ( | const char * | pFilePath | ) |
| static

bool isFullPath | ( | const char * | path | ) |
| static

bool isSubDirectory | ( | const char * | pParent,
|  | const char * | pDir
| ) |  |
| static

char * makeFullPathName | ( | const char * | path,
|  | char * | buffer,
|  | U32 | size,
|  | const char * | cwd = `NULL`
| ) |  |
| static

Initial value:
{
char* argBuffer = Con::getArgBuffer( 512 )
Con::getArgBuffer
char * getArgBuffer(U32 bufferSize)
Definition: compiledEval.cc:125

StringTableEntry makeRelativePathName | ( | const char * | path,
|  | const char * | to
| ) |  |
| static

S32 messageBox | ( | const UTF8 * | title,
|  | const UTF8 * | message,
|  | MBButtons | buttons = `MBOkCancel`,
|  | MBIcons | icon = `MIInformation`
| ) |  |
| static

void minimizeWindow | ( |  | ) |
| static

void openFolder | ( | const char * | path | ) |
| static

bool openWebBrowser | ( | const char * | webAddress | ) |
| static

StringTableEntry osGetTemporaryDirectory | ( |  | ) |
| static

void outputDebugString | ( | const char * | string | ) |
| static

bool pathCopy | ( | const char * | fromName,
|  | const char * | toName,
|  | bool | nooverwrite = `true`
| ) |  |
| static

void postQuitMessage | ( | const U32 | in_quitVal | ) |
| static

void process | ( |  | ) |
| static

void restartInstance | ( |  | ) |
| static

void restoreWindow | ( |  | ) |
| static

bool setClipboard | ( | const char * | text | ) |
| static

bool setCurrentDirectory | ( | StringTableEntry | newDir | ) |
| static

void setMainDotCsDir | ( | const char * | dir | ) |
| static

void setMouseLock | ( | bool | locked | ) |
| static

void setWindowSize | ( | U32 | newWidth,
|  | U32 | newHeight
| ) |  |
| static

void setWindowTitle | ( | const char * | title | ) |
| static

void shutdown | ( |  | ) |
| static

void sleep | ( | U32 | ms | ) |
| static

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

StringTableEntry stripBasePath | ( | const char * | path | ) |
| static

The documentation for this struct was generated from the following files:

- platform/platform.h
- gui/buttons/guiIconButtonCtrl.cc
- platform/platform.cc
- platform/platformFileIO.cc
- platformAndroid/AndroidAlerts.cpp
- platformAndroid/AndroidEvents.cpp
- platformAndroid/AndroidFileio.cpp
- platformAndroid/AndroidInput.cpp
- platformAndroid/AndroidMath.cpp
- platformAndroid/AndroidPlatform.cpp
- platformAndroid/AndroidProcessControl.cpp
- platformAndroid/AndroidStrings.cpp
- platformAndroid/AndroidTime.cpp
- platformAndroid/AndroidUtil.cpp
- platformAndroid/AndroidWindow.cpp
- platformAndroid/T2DActivity.cpp
- platformEmscripten/EmscriptenAlerts.cpp
- platformEmscripten/EmscriptenEvents.cpp
- platformEmscripten/EmscriptenFileio.cpp
- platformEmscripten/EmscriptenInput.cpp
- platformEmscripten/EmscriptenMath.cpp
- platformEmscripten/EmscriptenPlatform.cpp
- platformEmscripten/EmscriptenProcessControl.cpp
- platformEmscripten/EmscriptenStrings.cpp
- platformEmscripten/EmscriptenTime.cpp
- platformEmscripten/EmscriptenWindow.cpp