orx  stable
Portable Game Engine
OrxFile

Data Structures

struct  orxFILE_INFO
 

Macros

#define orxFILE_KU32_FLAG_INFO_DIRECTORY   0x00000008
 
#define orxFILE_KU32_FLAG_INFO_HIDDEN   0x00000004
 
#define orxFILE_KU32_FLAG_INFO_NORMAL   0x00000001
 
#define orxFILE_KU32_FLAG_INFO_READONLY   0x00000002
 
#define orxFILE_KU32_FLAG_OPEN_APPEND   0x40000000
 
#define orxFILE_KU32_FLAG_OPEN_BINARY   0x80000000
 
#define orxFILE_KU32_FLAG_OPEN_READ   0x10000000
 
#define orxFILE_KU32_FLAG_OPEN_WRITE   0x20000000
 

Typedefs

typedef struct __orxFILE_t orxFILE
 

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxFile_Close (orxFILE *_pstFile)
 
orxDLLAPI orxBOOL orxFASTCALL orxFile_Exists (const orxSTRING _zFileName)
 
orxDLLAPI void orxFASTCALL orxFile_Exit ()
 
orxDLLAPI void orxFASTCALL orxFile_FindClose (orxFILE_INFO *_pstFileInfo)
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindFirst (const orxSTRING _zSearchPattern, orxFILE_INFO *_pstFileInfo)
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindNext (orxFILE_INFO *_pstFileInfo)
 
orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetApplicationSaveDirectory (const orxSTRING _zSubPath)
 
orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetHomeDirectory (const orxSTRING _zSubPath)
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_GetInfo (const orxSTRING _zFileName, orxFILE_INFO *_pstFileInfo)
 
orxDLLAPI orxS64 orxFASTCALL orxFile_GetSize (const orxFILE *_pstFile)
 
orxDLLAPI orxS64 orxFASTCALL orxFile_GetTime (const orxFILE *_pstFile)
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_Init ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_MakeDirectory (const orxSTRING _zName)
 
orxDLLAPI orxFILE *orxFASTCALL orxFile_Open (const orxSTRING _zFileName, orxU32 _u32OpenFlags)
 
orxDLLAPI orxS32 orxCDECL orxFile_Print (orxFILE *_pstFile, const orxSTRING _zString,...)
 
orxDLLAPI orxS64 orxFASTCALL orxFile_Read (void *_pReadData, orxS64 _s64ElemSize, orxS64 _s64NbElem, orxFILE *_pstFile)
 
orxDLLAPI orxSTATUS orxFASTCALL orxFile_Remove (const orxSTRING _zFileName)
 
orxDLLAPI orxS64 orxFASTCALL orxFile_Seek (orxFILE *_pstFile, orxS64 _s64Position, orxSEEK_OFFSET_WHENCE _eWhence)
 
orxDLLAPI void orxFASTCALL orxFile_Setup ()
 
orxDLLAPI orxS64 orxFASTCALL orxFile_Tell (const orxFILE *_pstFile)
 
orxDLLAPI orxS64 orxFASTCALL orxFile_Write (const void *_pDataToWrite, orxS64 _s64ElemSize, orxS64 _s64NbElem, orxFILE *_pstFile)
 

Detailed Description

File / file system module Module that handles file / file system access

Macro Definition Documentation

#define orxFILE_KU32_FLAG_INFO_DIRECTORY   0x00000008

directory

Definition at line 52 of file orxFile.h.

#define orxFILE_KU32_FLAG_INFO_HIDDEN   0x00000004

hidden file

Definition at line 51 of file orxFile.h.

#define orxFILE_KU32_FLAG_INFO_NORMAL   0x00000001

normal file

Definition at line 49 of file orxFile.h.

#define orxFILE_KU32_FLAG_INFO_READONLY   0x00000002

read-only file

Definition at line 50 of file orxFile.h.

#define orxFILE_KU32_FLAG_OPEN_APPEND   0x40000000

descriptor positioned at the end of file

Definition at line 56 of file orxFile.h.

#define orxFILE_KU32_FLAG_OPEN_BINARY   0x80000000

binary file accessing

Definition at line 57 of file orxFile.h.

#define orxFILE_KU32_FLAG_OPEN_READ   0x10000000

opened for read

Definition at line 54 of file orxFile.h.

#define orxFILE_KU32_FLAG_OPEN_WRITE   0x20000000

opened for write

Definition at line 55 of file orxFile.h.

Typedef Documentation

typedef struct __orxFILE_t orxFILE

Internal File structure

Definition at line 77 of file orxFile.h.

Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxFile_Close ( orxFILE _pstFile)

Closes an oppened file

Parameters
[in]_pstFileFile's pointer to close
Returns
Returns the status of the operation
orxDLLAPI orxBOOL orxFASTCALL orxFile_Exists ( const orxSTRING  _zFileName)

Checks if a file/directory exists

Parameters
[in]_zFileNameConcerned file/directory
Returns
orxFALSE if _zFileName doesn't exist, orxTRUE otherwise
orxDLLAPI void orxFASTCALL orxFile_Exit ( )

Exits from the File Module

orxDLLAPI void orxFASTCALL orxFile_FindClose ( orxFILE_INFO _pstFileInfo)

Closes a search (frees the memory allocated for this search)

Parameters
[in]_pstFileInfoInformation returned during search
orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindFirst ( const orxSTRING  _zSearchPattern,
orxFILE_INFO _pstFileInfo 
)

Starts a new file search: finds the first file/directory that will match to the given pattern (ex: /bin/foo*)

Parameters
[in]_zSearchPatternPattern used for file/directory search
[out]_pstFileInfoInformation about the first file found
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindNext ( orxFILE_INFO _pstFileInfo)

Continues a file search: finds the next occurrence of a pattern, the search has to be started with orxFile_FindFirst

Parameters
[in,out]_pstFileInfoInformation about the last found file/directory
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetApplicationSaveDirectory ( const orxSTRING  _zSubPath)

Gets current user's application save directory (without trailing separator)

Parameters
[in]_zSubPathSub-path to append to the application save directory, orxNULL for none
Returns
Current user's application save directory, use it immediately or copy it as it will be modified by the next call to orxFile_GetHomeDirectory() or orxFile_GetApplicationSaveDirectory()
orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetHomeDirectory ( const orxSTRING  _zSubPath)

Gets current user's home directory (without trailing separator)

Parameters
[in]_zSubPathSub-path to append to the home directory, orxNULL for none
Returns
Current user's home directory, use it immediately or copy it as will be modified by the next call to orxFile_GetHomeDirectory() or orxFile_GetApplicationSaveDirectory()
orxDLLAPI orxSTATUS orxFASTCALL orxFile_GetInfo ( const orxSTRING  _zFileName,
orxFILE_INFO _pstFileInfo 
)

Retrieves a file/directory information

Parameters
[in]_zFileNameConcerned file/directory name
[out]_pstFileInfoInformation of the file/directory
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxS64 orxFASTCALL orxFile_GetSize ( const orxFILE _pstFile)

Retrieves a file's size

Parameters
[in]_pstFileConcerned file
Returns
Returns the length of the file, <= 0 if invalid
orxDLLAPI orxS64 orxFASTCALL orxFile_GetTime ( const orxFILE _pstFile)

Retrieves a file's time of last modification

Parameters
[in]_pstFileConcerned file
Returns
Returns the time of the last modification, in seconds, since epoch
orxDLLAPI orxSTATUS orxFASTCALL orxFile_Init ( )

Inits the File Module

orxDLLAPI orxSTATUS orxFASTCALL orxFile_MakeDirectory ( const orxSTRING  _zName)

Makes a directory, works recursively if needed

Parameters
[in]_zNameName of the directory to make
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxFILE* orxFASTCALL orxFile_Open ( const orxSTRING  _zFileName,
orxU32  _u32OpenFlags 
)

Opens a file for later read or write operation

Parameters
[in]_zFileNameFull file's path to open
[in]_u32OpenFlagsList of used flags when opened
Returns
a File pointer (or orxNULL if an error has occurred)
orxDLLAPI orxS32 orxCDECL orxFile_Print ( orxFILE _pstFile,
const orxSTRING  _zString,
  ... 
)

Prints a formatted string to a file

Parameters
[in]_pstFilePointer on the file descriptor
[in]_zStringFormatted string
Returns
Returns the number of written characters
orxDLLAPI orxS64 orxFASTCALL orxFile_Read ( void _pReadData,
orxS64  _s64ElemSize,
orxS64  _s64NbElem,
orxFILE _pstFile 
)

Reads data from a file

Parameters
[out]_pReadDataBuffer that will contain read data
[in]_s64ElemSizeSize of 1 element
[in]_s64NbElemNumber of elements
[in]_pstFilePointer on the file descriptor
Returns
Returns the number of read elements (not bytes)
orxDLLAPI orxSTATUS orxFASTCALL orxFile_Remove ( const orxSTRING  _zFileName)

Removes a file or an empty directory

Parameters
[in]_zFileNameConcerned file / directory
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxS64 orxFASTCALL orxFile_Seek ( orxFILE _pstFile,
orxS64  _s64Position,
orxSEEK_OFFSET_WHENCE  _eWhence 
)

Seeks to a position in the given file

Parameters
[in]_pstFileConcerned file
[in]_s64PositionPosition (from start) where to set the indicator
[in]_eWhenceStarting point for the offset computation (start, current position or end)
Returns
Absolute cursor position if successful, -1 otherwise
orxDLLAPI void orxFASTCALL orxFile_Setup ( )

File module setup

orxDLLAPI orxS64 orxFASTCALL orxFile_Tell ( const orxFILE _pstFile)

Tells the current position of the indicator in a file

Parameters
[in]_pstFileConcerned file
Returns
Returns the current position of the file indicator, -1 is invalid
orxDLLAPI orxS64 orxFASTCALL orxFile_Write ( const void _pDataToWrite,
orxS64  _s64ElemSize,
orxS64  _s64NbElem,
orxFILE _pstFile 
)

Writes data to a file

Parameters
[in]_pDataToWriteBuffer that contains the data to write
[in]_s64ElemSizeSize of 1 element
[in]_s64NbElemNumber of elements
[in]_pstFilePointer on the file descriptor
Returns
Returns the number of written elements (not bytes)

Generated for orx by doxygen 1.5.6