Torque2D Reference
Loading...
Searching...
No Matches
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.
 
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.
 
static void restartInstance ()
 
static void postQuitMessage (const U32 in_quitVal)
 
static void forceShutdown (S32 returnValue)
 
static StringTableEntry getUserHomeDirectory ()
 User.
 
static StringTableEntry getUserDataDirectory ()
 
static void initWindow (const Point2I &initialSize, const char *name)
 Window.
 
static void setWindowTitle (const char *title)
 
static void setWindowSize (U32 newWidth, U32 newHeight)
 
static const Point2IgetWindowSize ()
 
static void minimizeWindow ()
 
static void restoreWindow ()
 
static void setMouseLock (bool locked)
 
static void AlertOK (const char *windowTitle, const char *message)
 GUI.
 
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.
 
static void disableKeyboardTranslation (void)
 
static U32 getTime (void)
 Date & Time.
 
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.
 
static void debugBreak ()
 Debug.
 
static void outputDebugString (const char *string)
 
static void cprintf (const char *str)
 
static StringTableEntry getCurrentDirectory ()
 File IO.
 
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.
 
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

◆ FILE_HANDLE

typedef void* FILE_HANDLE

Member Enumeration Documentation

◆ DFILE_STATUS

Enumerator
DFILE_OK 

Member Function Documentation

◆ addExcludedDirectory()

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

◆ advanceTime()

void advanceTime ( U32  delta)
static

◆ AlertOK()

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

GUI.

◆ AlertOKCancel()

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

◆ AlertRetry()

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

◆ AlertYesNo()

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

◆ clearExcludedDirectories()

void clearExcludedDirectories ( )
static

◆ compareFileTimes()

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

◆ cprintf()

void cprintf ( const char *  str)
static

◆ createPath()

bool createPath ( const char *  path)
static

◆ createUUID()

StringTableEntry createUUID ( void  )
static

Misc.

◆ debugBreak()

void debugBreak ( )
static

Debug.

◆ deleteDirectory()

bool deleteDirectory ( const char *  pPath)
static

◆ disableKeyboardTranslation()

void disableKeyboardTranslation ( void  )
static

◆ dumpDirectories()

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

◆ dumpPath()

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

◆ enableKeyboardTranslation()

void enableKeyboardTranslation ( void  )
static

◆ fileDelete()

bool fileDelete ( const char *  name)
static

◆ fileRename()

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

◆ fileTouch()

static bool fileTouch ( const char *  name)
static

◆ forceShutdown()

void forceShutdown ( S32  returnValue)
static

◆ getBackgroundSleepTime()

S32 getBackgroundSleepTime ( )
static

◆ getClipboard()

const char * getClipboard ( )
static

◆ getCurrentDirectory()

StringTableEntry getCurrentDirectory ( )
static

File IO.

◆ getExecutableName()

StringTableEntry getExecutableName ( )
static

◆ getExecutablePath()

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

◆ getFileSize()

S32 getFileSize ( const char *  pFilePath)
static

◆ getFileTimes()

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

◆ getLocalTime()

void getLocalTime ( LocalTime lt)
static

Get time as long integer.

Convert to local time, thread safe.

Fill the return struct

◆ getMainDotCsDir()

StringTableEntry getMainDotCsDir ( )
static

◆ getPrefsPath()

StringTableEntry getPrefsPath ( const char *  file = NULL)
static

◆ getRandom()

F32 getRandom ( )
static

Math.

◆ getRealMilliseconds()

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

◆ getTemporaryDirectory()

StringTableEntry getTemporaryDirectory ( )
static

◆ getTemporaryFileName()

StringTableEntry getTemporaryFileName ( )
static

◆ getTime()

U32 getTime ( void  )
static

Date & Time.

Gets the time in seconds since the Epoch.

◆ getUserDataDirectory()

const char * getUserDataDirectory ( )
static

◆ getUserHomeDirectory()

const char * getUserHomeDirectory ( )
static

User.

◆ getVirtualMilliseconds()

U32 getVirtualMilliseconds ( void  )
static

◆ getWindowSize()

const Point2I & getWindowSize ( )
static

◆ hasExtension()

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

◆ hasSubDirectory()

bool hasSubDirectory ( const char *  pPath)
static

◆ init()

void init ( )
static

Application.

◆ initConsole()

void initConsole ( )
static

◆ initWindow()

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

Window.

◆ isDirectory()

bool isDirectory ( const char *  pDirPath)
static

◆ isExcludedDirectory()

bool isExcludedDirectory ( const char *  pDir)
static

◆ isFile()

bool isFile ( const char *  pFilePath)
static

◆ isFullPath()

bool isFullPath ( const char *  path)
static

◆ isSubDirectory()

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

◆ makeFullPathName()

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

◆ makeRelativePathName()

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

◆ messageBox()

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

◆ minimizeWindow()

void minimizeWindow ( )
static

◆ openFolder()

void openFolder ( const char *  path)
static

◆ openWebBrowser()

bool openWebBrowser ( const char *  webAddress)
static

◆ osGetTemporaryDirectory()

StringTableEntry osGetTemporaryDirectory ( )
static

◆ outputDebugString()

void outputDebugString ( const char *  string)
static

◆ pathCopy()

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

◆ postQuitMessage()

void postQuitMessage ( const U32  in_quitVal)
static

◆ process()

void process ( )
static

◆ restartInstance()

void restartInstance ( )
static

◆ restoreWindow()

void restoreWindow ( )
static

◆ setClipboard()

bool setClipboard ( const char *  text)
static

◆ setCurrentDirectory()

bool setCurrentDirectory ( StringTableEntry  newDir)
static

◆ setMainDotCsDir()

void setMainDotCsDir ( const char *  dir)
static

◆ setMouseLock()

void setMouseLock ( bool  locked)
static

◆ setWindowSize()

void setWindowSize ( U32  newWidth,
U32  newHeight 
)
static

◆ setWindowTitle()

void setWindowTitle ( const char *  title)
static

◆ shutdown()

void shutdown ( )
static

◆ sleep()

void sleep ( U32  ms)
static

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

◆ stripBasePath()

StringTableEntry stripBasePath ( const char *  path)
static

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