orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
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 orxSTATUS orxFASTCALL orxFile_Delete (const orxSTRING _zFileName)
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 _u32Flags)
orxDLLAPI orxS32 orxCDECL orxFile_Print (orxFILE *_pstFile, const orxSTRING _zString,...)
orxDLLAPI orxS64 orxFASTCALL orxFile_Read (void *_pBuffer, orxS64 _s64ElemSize, orxS64 _s64NbElem, orxFILE *_pstFile)
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 *_pBuffer, orxS64 _s64ElemSize, orxS64 _s64NbElem, orxFILE *_pstFile)

Detailed Description

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

Macro Definition Documentation

◆ orxFILE_KU32_FLAG_INFO_DIRECTORY

#define orxFILE_KU32_FLAG_INFO_DIRECTORY   0x00000008

directory

Definition at line 53 of file orxFile.h.

◆ orxFILE_KU32_FLAG_INFO_HIDDEN

#define orxFILE_KU32_FLAG_INFO_HIDDEN   0x00000004

hidden file

Definition at line 52 of file orxFile.h.

◆ orxFILE_KU32_FLAG_INFO_NORMAL

#define orxFILE_KU32_FLAG_INFO_NORMAL   0x00000001

normal file

Definition at line 50 of file orxFile.h.

◆ orxFILE_KU32_FLAG_INFO_READONLY

#define orxFILE_KU32_FLAG_INFO_READONLY   0x00000002

read-only file

Definition at line 51 of file orxFile.h.

◆ orxFILE_KU32_FLAG_OPEN_APPEND

#define orxFILE_KU32_FLAG_OPEN_APPEND   0x40000000

descriptor positioned at the end of file

Definition at line 57 of file orxFile.h.

◆ orxFILE_KU32_FLAG_OPEN_BINARY

#define orxFILE_KU32_FLAG_OPEN_BINARY   0x80000000

binary file accessing

Definition at line 58 of file orxFile.h.

◆ orxFILE_KU32_FLAG_OPEN_READ

#define orxFILE_KU32_FLAG_OPEN_READ   0x10000000

opened for read

Definition at line 55 of file orxFile.h.

◆ orxFILE_KU32_FLAG_OPEN_WRITE

#define orxFILE_KU32_FLAG_OPEN_WRITE   0x20000000

opened for write

Definition at line 56 of file orxFile.h.

Typedef Documentation

◆ orxFILE

typedef struct __orxFILE_t orxFILE

Internal File structure

Definition at line 78 of file orxFile.h.

Function Documentation

◆ orxFile_Close()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_Close ( orxFILE * _pstFile)
extern

Closes an opened file

Parameters
[in]_pstFileConcerned file
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxFile_Delete()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_Delete ( const orxSTRING _zFileName)
extern

Deletes a file or an empty directory

Parameters
[in]_zFileNameFull file path to delete
Returns
orxSTATUS_SUCCESS upon success, orxSTATUS_FAILURE otherwise

◆ orxFile_Exists()

orxDLLAPI orxBOOL orxFASTCALL orxFile_Exists ( const orxSTRING _zFileName)
extern

Checks if a file/directory exists

Parameters
[in]_zFileNameConcerned file/directory
Returns
orxFALSE if _zFileName doesn't exist, orxTRUE otherwise

◆ orxFile_Exit()

orxDLLAPI void orxFASTCALL orxFile_Exit ( )
extern

Exits from the File Module

◆ orxFile_FindClose()

orxDLLAPI void orxFASTCALL orxFile_FindClose ( orxFILE_INFO * _pstFileInfo)
extern

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

Parameters
[in]_pstFileInfoInformation returned during search

◆ orxFile_FindFirst()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindFirst ( const orxSTRING _zSearchPattern,
orxFILE_INFO * _pstFileInfo )
extern

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

◆ orxFile_FindNext()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_FindNext ( orxFILE_INFO * _pstFileInfo)
extern

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

◆ orxFile_GetApplicationSaveDirectory()

orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetApplicationSaveDirectory ( const orxSTRING _zSubPath)
extern

Gets current user's application save directory using linux separators (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()

◆ orxFile_GetHomeDirectory()

orxDLLAPI const orxSTRING orxFASTCALL orxFile_GetHomeDirectory ( const orxSTRING _zSubPath)
extern

Gets current user's home directory using linux separators (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()

◆ orxFile_GetInfo()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_GetInfo ( const orxSTRING _zFileName,
orxFILE_INFO * _pstFileInfo )
extern

Retrieves a file/directory information

Parameters
[in]_zFileNameConcerned file/directory name
[out]_pstFileInfoInformation of the file/directory
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxFile_GetSize()

orxDLLAPI orxS64 orxFASTCALL orxFile_GetSize ( const orxFILE * _pstFile)
extern

Retrieves the size of a file

Parameters
[in]_pstFileConcerned file
Returns
The length of the file, <= 0 if invalid

◆ orxFile_GetTime()

orxDLLAPI orxS64 orxFASTCALL orxFile_GetTime ( const orxFILE * _pstFile)
extern

Retrieves the last modification time of a file

Parameters
[in]_pstFileConcerned file
Returns
The time of the last modification, in seconds, since epoch

◆ orxFile_Init()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_Init ( )
extern

Inits the File Module

◆ orxFile_MakeDirectory()

orxDLLAPI orxSTATUS orxFASTCALL orxFile_MakeDirectory ( const orxSTRING _zName)
extern

Makes a directory, works recursively if needed

Parameters
[in]_zNameName of the directory to make
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxFile_Open()

orxDLLAPI orxFILE *orxFASTCALL orxFile_Open ( const orxSTRING _zFileName,
orxU32 _u32Flags )
extern

Opens a file for later read or write operation

Parameters
[in]_zFileNameFull file path to open
[in]_u32FlagsFlags used to determine the file access mode
Returns
a File pointer (or orxNULL if an error has occurred)

◆ orxFile_Print()

orxDLLAPI orxS32 orxCDECL orxFile_Print ( orxFILE * _pstFile,
const orxSTRING _zString,
... )
extern

Prints a formatted string to a file

Parameters
[in]_pstFilePointer to the file descriptor
[in]_zStringFormatted string
Returns
The number of written characters

◆ orxFile_Read()

orxDLLAPI orxS64 orxFASTCALL orxFile_Read ( void * _pBuffer,
orxS64 _s64ElemSize,
orxS64 _s64NbElem,
orxFILE * _pstFile )
extern

Reads data from a file

Parameters
[out]_pBufferBuffer that will contain read data
[in]_s64ElemSizeSize of 1 element
[in]_s64NbElemNumber of elements
[in]_pstFilePointer to the file descriptor
Returns
The number of read elements (not bytes)

◆ orxFile_Seek()

orxDLLAPI orxS64 orxFASTCALL orxFile_Seek ( orxFILE * _pstFile,
orxS64 _s64Position,
orxSEEK_OFFSET_WHENCE _eWhence )
extern

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

◆ orxFile_Setup()

orxDLLAPI void orxFASTCALL orxFile_Setup ( )
extern

File module setup

◆ orxFile_Tell()

orxDLLAPI orxS64 orxFASTCALL orxFile_Tell ( const orxFILE * _pstFile)
extern

Tells the current position of the indicator in a file

Parameters
[in]_pstFileConcerned file
Returns
The current position of the file indicator, -1 is invalid

◆ orxFile_Write()

orxDLLAPI orxS64 orxFASTCALL orxFile_Write ( const void * _pBuffer,
orxS64 _s64ElemSize,
orxS64 _s64NbElem,
orxFILE * _pstFile )
extern

Writes data to a file

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

Generated for orx by doxygen 1.8.11