pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
Defines | Typedefs | Functions
Plank File class
Plank classes

A crossplatform file reading/writing utility. More...

Defines

#define PLANKFILE_READ   (1 << 0)
 Flag to identify 'read' mode.
#define PLANKFILE_WRITE   (1 << 1)
 Flag to identify 'write' mode.
#define PLANKFILE_BINARY   (1 << 2)
 Flag to identify 'binary' mode.
#define PLANKFILE_APPEND   (1 << 3)
 Flag to identify 'append' mode.
#define PLANKFILE_NEW   (1 << 4)
 Flag to identify 'new' mode.
#define PLANKFILE_BIGENDIAN   (1 << 5)
 Flag to identify big endian mode for binary files (otherwise it will be little endian).
#define PLANKFILE_OWNMULTI   (1 << 6)
 Flag to identify that a multi file object should be owned by the File object.
#define PLANKFILE_DYNAMICARRAYOWNED   (1 << 6)
 Flag to identify when in DynamciArray mode that the array is owned by this object.
#define PLANKFILE_MASK   (PLANKFILE_READ | PLANKFILE_WRITE | PLANKFILE_BINARY | PLANKFILE_APPEND | PLANKFILE_NEW)
 Mode mask with all the mode flags except PLANKFILE_BIGENDIAN.
#define PLANKFILE_ALL   (PLANKFILE_MASK | PLANKFILE_BIGENDIAN)
 Mode mask with all the mode flags.

Typedefs

typedef struct PlankFile * PlankFileRef
 An opaque reference to the Plank File object.

Functions

PlankResult pl_FileErase (const char *filepath)
 Delete a file with the given path form the filesystem.
PlankFileRef pl_File_CreateAndInit ()
 Create and initialise a Plank File object and return an oqaque reference to it.
PlankFileRef pl_File_Create ()
 Create a Plank File object and return an oqaque reference to it.
PlankResult pl_File_Init (PlankFileRef p)
 Initialise a Plank File object.
PlankResult pl_File_DeInit (PlankFileRef p)
 Deinitialise a Plank File object.
PlankResult pl_File_Destroy (PlankFileRef p)
 Destroy a Plank File object.
PlankResult pl_File_Open (PlankFileRef p, const char *filepath, const int mode)
 Open a file.
PlankResult pl_File_OpenTextRead (PlankFileRef p, const char *filepath, const PlankB andWrite)
 Open a text file for reading and optionally writing.
PlankResult pl_File_OpenTextWrite (PlankFileRef p, const char *filepath, const PlankB andRead, const PlankB replaceExistingFile)
 Open a text file for writing and optionally reading.
PlankResult pl_File_OpenBinaryRead (PlankFileRef p, const char *filepath, const PlankB andWrite, const PlankB isBigEndian)
 Open a binary file for reading and optionally writing.
PlankResult pl_File_OpenBinaryWrite (PlankFileRef p, const char *filepath, const PlankB andRead, const PlankB replaceExistingFile, const PlankB isBigEndian)
 Open a binary file for writing and optionally reading.
PlankResult pl_File_OpenBinaryNativeEndianRead (PlankFileRef p, const char *filepath, const PlankB andWrite)
 Open a binary file for reading and optionally writing in the native endian format.
PlankResult pl_File_OpenBinaryNativeEndianWrite (PlankFileRef p, const char *filepath, const PlankB andRead, const PlankB replaceExistingFile)
 Open a binary file for writing and optionally reading in the native endian format.
PlankB pl_File_IsBigEndian (PlankFileRef p)
 Determine if a file object is in big endian format.
PlankB pl_File_IsLittleEndian (PlankFileRef p)
 Determine if a file object is in little endian format.
PlankB pl_File_IsNativeEndian (PlankFileRef p)
 Determine if a file object is in the native endian format.
PlankResult pl_File_Close (PlankFileRef p)
 Close a file.
PlankResult pl_File_SetPosition (PlankFileRef p, const PlankLL position)
 Set the current position of the file read/write pointer.
PlankResult pl_File_OffsetPosition (PlankFileRef p, const PlankLL offset)
 Offset the current position of the file read/write pointer.
PlankResult pl_File_ResetPosition (PlankFileRef p)
 Reset the current position of the file read/write pointer to the start of the file.
PlankResult pl_File_SetPositionEnd (PlankFileRef p)
 Set the current position of the file read/write pointer to the end of the file.
PlankB pl_File_IsValid (PlankFileRef p)
 Determine if a file object is valid.
PlankB pl_File_IsEOF (PlankFileRef p)
 Determine if a file object read/write pointer has reached the end of the file.
PlankResult pl_File_SetEOF (PlankFileRef p)
 Sets the file object read/write pointer to the end of the file.
PlankResult pl_File_GetPosition (PlankFileRef p, PlankLL *position)
 Get the current position of the file read/write pointer.
PlankResult pl_File_SetMode (PlankFileRef p, const int mode)
 Reopen the file with a different mode (e.g, read/write/binary etc).
PlankResult pl_File_Read (PlankFileRef p, PlankP data, const int maximumBytes, int *bytesRead)
 Read an array of bytes from the file.
PlankResult pl_File_ReadC (PlankFileRef p, char *data)
 Read one signed byte from the file.
PlankResult pl_File_ReadS (PlankFileRef p, short *data)
 Read a short from the file (16-bit int).
PlankResult pl_File_ReadI (PlankFileRef p, int *data)
 Read an int from the file (32-bit int).
PlankResult pl_File_ReadI24 (PlankFileRef p, PlankI24 *data)
 Read a 24-bit int from the file (i.e.
PlankResult pl_File_ReadLL (PlankFileRef p, PlankLL *data)
 Read a long from the file.
PlankResult pl_File_ReadUC (PlankFileRef p, unsigned char *data)
 Read one unsigned byte from the file.
PlankResult pl_File_ReadUS (PlankFileRef p, unsigned short *data)
 Read an unsigned short from the file (16-bit int).
PlankResult pl_File_ReadUI (PlankFileRef p, unsigned int *data)
 Read an unsigned int from the file (32-bit int).
PlankResult pl_File_ReadUI24 (PlankFileRef p, PlankUI24 *data)
 Read an unsigned 24-bit int from the file (i.e.
PlankResult pl_File_ReadUL (PlankFileRef p, PlankUL *data)
 Read a long from the file.
PlankResult pl_File_ReadULL (PlankFileRef p, PlankULL *data)
 Read an unsigned 64-bit int from the file (i.e.
PlankResult pl_File_ReadF (PlankFileRef p, float *data)
 Read a float from the file (32-bit float).
PlankResult pl_File_ReadD (PlankFileRef p, double *data)
 Read a double from the file (64-bit float).
PlankResult pl_File_ReadLine (PlankFileRef p, char *text, const int maximumLength)
 Read an array of bytes as text upto the next line ending (or the end of the file if sooner).
PlankResult pl_File_SkipBytes (PlankFileRef p, const int numBytes)
 Skip over a number of bytes in the file.
PlankResult pl_File_Write (PlankFileRef p, const void *data, const int maximumBytes)
 Write an array of bytes to the file.
PlankResult pl_File_WriteC (PlankFileRef p, char data)
 Write one signed byte to the file.
PlankResult pl_File_WriteS (PlankFileRef p, short data)
 Write a short to the file (16-bit int).
PlankResult pl_File_WriteI (PlankFileRef p, int data)
 Write an int to the file (32-bit int).
PlankResult pl_File_WriteI24 (PlankFileRef p, PlankI24 data)
 Write a 24-bit int to the file (i.e., 3 bytes).
PlankResult pl_File_WriteLL (PlankFileRef p, PlankLL data)
 Write a long to the file.
PlankResult pl_File_WriteUC (PlankFileRef p, unsigned char data)
 Write one unsigned byte to the file.
PlankResult pl_File_WriteUS (PlankFileRef p, unsigned short data)
 Write an unsigned short to the file (16-bit int).
PlankResult pl_File_WriteUI (PlankFileRef p, unsigned int data)
 Write an unsigned int to the file (32-bit int).
PlankResult pl_File_WriteUI24 (PlankFileRef p, PlankUI24 data)
 Write an unsigned 24-bit int to the file (i.e., 3 bytes).
PlankResult pl_File_WriteUL (PlankFileRef p, PlankUL data)
 Write an unisigned long to the file.
PlankResult pl_File_WriteULL (PlankFileRef p, PlankULL data)
 Write an unsigned 64-bit int to the file.
PlankResult pl_File_WriteF (PlankFileRef p, float data)
 Write a float to the file (32-bit float).
PlankResult pl_File_WriteD (PlankFileRef p, double data)
 Write a double to the file (64-bit float).
PlankResult pl_File_WriteString (PlankFileRef p, const char *text)
 Write string to the file.
PlankResult pl_File_WriteLine (PlankFileRef p, const char *text)
 Write line of text to the file.

Detailed Description

A crossplatform file reading/writing utility.

Most of the "member functions" return a PlankResult which is a status and/or error code.


Define Documentation

#define PLANKFILE_ALL   (PLANKFILE_MASK | PLANKFILE_BIGENDIAN)

Mode mask with all the mode flags.

#define PLANKFILE_APPEND   (1 << 3)

Flag to identify 'append' mode.

#define PLANKFILE_BIGENDIAN   (1 << 5)

Flag to identify big endian mode for binary files (otherwise it will be little endian).

#define PLANKFILE_BINARY   (1 << 2)

Flag to identify 'binary' mode.

#define PLANKFILE_DYNAMICARRAYOWNED   (1 << 6)

Flag to identify when in DynamciArray mode that the array is owned by this object.

#define PLANKFILE_MASK   (PLANKFILE_READ | PLANKFILE_WRITE | PLANKFILE_BINARY | PLANKFILE_APPEND | PLANKFILE_NEW)

Mode mask with all the mode flags except PLANKFILE_BIGENDIAN.

#define PLANKFILE_NEW   (1 << 4)

Flag to identify 'new' mode.

#define PLANKFILE_OWNMULTI   (1 << 6)

Flag to identify that a multi file object should be owned by the File object.

#define PLANKFILE_READ   (1 << 0)

Flag to identify 'read' mode.

#define PLANKFILE_WRITE   (1 << 1)

Flag to identify 'write' mode.


Typedef Documentation

typedef struct PlankFile* PlankFileRef

An opaque reference to the Plank File object.


Function Documentation

PlankResult pl_File_Close ( PlankFileRef  p)

Close a file.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankFileRef pl_File_Create ( )

Create a Plank File object and return an oqaque reference to it.

Returns:
A Plank File object as an opaque reference or PLANK_NULL.
PlankFileRef pl_File_CreateAndInit ( )

Create and initialise a Plank File object and return an oqaque reference to it.

Returns:
A Plank File object as an opaque reference or PLANK_NULL.
PlankResult pl_File_DeInit ( PlankFileRef  p)

Deinitialise a Plank File object.

This also closes the file if it is still open.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_Destroy ( PlankFileRef  p)

Destroy a Plank File object.

This also closes the file if it is still open.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_GetPosition ( PlankFileRef  p,
PlankLL *  position 
)

Get the current position of the file read/write pointer.

Parameters:
pThe Plank File object.
positionA pointer to a variable that will receive the result.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_Init ( PlankFileRef  p)

Initialise a Plank File object.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankB pl_File_IsBigEndian ( PlankFileRef  p)

Determine if a file object is in big endian format.

Parameters:
pThe Plank File object.
Returns:
true if the file object refers to a file opened in big endian format, othewise returns false (i.e., it is litte endian).
PlankB pl_File_IsEOF ( PlankFileRef  p)

Determine if a file object read/write pointer has reached the end of the file.

Parameters:
pThe Plank File object.
Returns:
true if the file read/write pointer has reached the end of the file, otherwise false.
PlankB pl_File_IsLittleEndian ( PlankFileRef  p)

Determine if a file object is in little endian format.

Parameters:
pThe Plank File object.
Returns:
true if the file object refers to a file opened in little endian format, othewise returns false (i.e., it is big endian).
PlankB pl_File_IsNativeEndian ( PlankFileRef  p)

Determine if a file object is in the native endian format.

Parameters:
pThe Plank File object.
Returns:
true if the file object refers to a file opened in endian format of the machine on which this is running, othewise returns false.
PlankB pl_File_IsValid ( PlankFileRef  p)

Determine if a file object is valid.

This currently checks only if the file object is null.

Parameters:
pThe Plank File object.
Returns:
true if the file object is not null.
PlankResult pl_File_OffsetPosition ( PlankFileRef  p,
const PlankLL  offset 
)

Offset the current position of the file read/write pointer.

Parameters:
pThe Plank File object.
offsetThe offset by which to move the file read/write pointer.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_Open ( PlankFileRef  p,
const char *  filepath,
const int  mode 
)

Open a file.

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
modeA bit mask code to identify the mode in which to open the file.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenBinaryNativeEndianRead ( PlankFileRef  p,
const char *  filepath,
const PlankB  andWrite 
)

Open a binary file for reading and optionally writing in the native endian format.

This will open a file for reading/writing in little endian format on little endian machines (x86, x86_64, ARM etc) and big endian format on big endian machines (e.g., PPC).

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andWriteIf true the file will also be opened for writing.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenBinaryNativeEndianWrite ( PlankFileRef  p,
const char *  filepath,
const PlankB  andRead,
const PlankB  replaceExistingFile 
)

Open a binary file for writing and optionally reading in the native endian format.

This will open a file for reading/writing in little endian format on little endian machines (x86, x86_64, ARM etc) and big endian format on big endian machines (e.g., PPC).

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andReadIf true the file will also be opened for reading.
replaceExistingFileIf true any exising file will be erased otherwise data will be appended to the existing file.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenBinaryRead ( PlankFileRef  p,
const char *  filepath,
const PlankB  andWrite,
const PlankB  isBigEndian 
)

Open a binary file for reading and optionally writing.

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andWriteIf true the file will also be opened for writing.
isBigEndianSet to true to write multibyte values in big endian format, otherwise write in little endian format.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenBinaryWrite ( PlankFileRef  p,
const char *  filepath,
const PlankB  andRead,
const PlankB  replaceExistingFile,
const PlankB  isBigEndian 
)

Open a binary file for writing and optionally reading.

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andReadIf true the file will also be opened for reading.
replaceExistingFileIf true any exising file will be erased otherwise data will be appended to the existing file.
isBigEndianSet to true to write multibyte values in big endian format, otherwise write in little endian format.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenTextRead ( PlankFileRef  p,
const char *  filepath,
const PlankB  andWrite 
)

Open a text file for reading and optionally writing.

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andWriteIf true the file will also be opened for writing.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_OpenTextWrite ( PlankFileRef  p,
const char *  filepath,
const PlankB  andRead,
const PlankB  replaceExistingFile 
)

Open a text file for writing and optionally reading.

Parameters:
pThe Plank File object.
filepathThe filepath of the file to open.
andReadIf true the file will also be opened for reading.
replaceExistingFileIf true any exising file will be erased otherwise data will be appended to the existing file.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_Read ( PlankFileRef  p,
PlankP  data,
const int  maximumBytes,
int *  bytesRead 
)

Read an array of bytes from the file.

NB as this reads raw bytes it takes no account of the likely endian format of any data read.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
maximumBytesThe number of bytes to read.
bytesReadOn return contains the number of bytes read (pass PLANK_NULL to ignore this).
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadC ( PlankFileRef  p,
char *  data 
)

Read one signed byte from the file.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadD ( PlankFileRef  p,
double *  data 
)

Read a double from the file (64-bit float).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadF ( PlankFileRef  p,
float *  data 
)

Read a float from the file (32-bit float).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadI ( PlankFileRef  p,
int *  data 
)

Read an int from the file (32-bit int).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadI24 ( PlankFileRef  p,
PlankI24 data 
)

Read a 24-bit int from the file (i.e.

3 bytes).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadLine ( PlankFileRef  p,
char *  text,
const int  maximumLength 
)

Read an array of bytes as text upto the next line ending (or the end of the file if sooner).

Parameters:
pThe Plank File object.
textA pointer to the memory location that will receive the data.
maximumLengthThe maximum number of bytes to read.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadLL ( PlankFileRef  p,
PlankLL *  data 
)

Read a long from the file.

This will be a 32-bit int on 32-bit systems (i.e., 4 bytes) and a 64-bit int on 64-bit systems (i.e., 8 bytes) even on Windows where a 'long' is normally 32 bits on both architectures.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful. Read a 64-bit int from the file (i.e. 8 bytes).
Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadS ( PlankFileRef  p,
short *  data 
)

Read a short from the file (16-bit int).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadUC ( PlankFileRef  p,
unsigned char *  data 
)

Read one unsigned byte from the file.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadUI ( PlankFileRef  p,
unsigned int *  data 
)

Read an unsigned int from the file (32-bit int).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadUI24 ( PlankFileRef  p,
PlankUI24 data 
)

Read an unsigned 24-bit int from the file (i.e.

3 bytes).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadUL ( PlankFileRef  p,
PlankUL *  data 
)

Read a long from the file.

This will be a 32-bit int on 32-bit systems (i.e., 4 bytes) and a 64-bit int on 64-bit systems (i.e., 8 bytes) even on Windows where a 'long' is normally 32 bits on both architectures.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadULL ( PlankFileRef  p,
PlankULL *  data 
)

Read an unsigned 64-bit int from the file (i.e.

8 bytes).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ReadUS ( PlankFileRef  p,
unsigned short *  data 
)

Read an unsigned short from the file (16-bit int).

Parameters:
pThe Plank File object.
dataA pointer to the memory location that will receive the data.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_ResetPosition ( PlankFileRef  p)

Reset the current position of the file read/write pointer to the start of the file.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_SetEOF ( PlankFileRef  p)

Sets the file object read/write pointer to the end of the file.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_SetMode ( PlankFileRef  p,
const int  mode 
)

Reopen the file with a different mode (e.g, read/write/binary etc).

Parameters:
pThe Plank File object.
modeA bit mask code to identify the mode in which to open the file.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_SetPosition ( PlankFileRef  p,
const PlankLL  position 
)

Set the current position of the file read/write pointer.

Parameters:
pThe Plank File object.
positionThe position within the file in bytes.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_SetPositionEnd ( PlankFileRef  p)

Set the current position of the file read/write pointer to the end of the file.

Parameters:
pThe Plank File object.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_SkipBytes ( PlankFileRef  p,
const int  numBytes 
)

Skip over a number of bytes in the file.

Parameters:
pThe Plank File object.
numBytesThe number of bytes to skip.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_Write ( PlankFileRef  p,
const void *  data,
const int  maximumBytes 
)

Write an array of bytes to the file.

NB as this reads raw bytes it takes no account of the likely endian format of any data read.

Parameters:
pThe Plank File object.
dataA pointer to the memory location that is the source of the data.
maximumBytesThe number of bytes to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteC ( PlankFileRef  p,
char  data 
)

Write one signed byte to the file.

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteD ( PlankFileRef  p,
double  data 
)

Write a double to the file (64-bit float).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteF ( PlankFileRef  p,
float  data 
)

Write a float to the file (32-bit float).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteI ( PlankFileRef  p,
int  data 
)

Write an int to the file (32-bit int).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteI24 ( PlankFileRef  p,
PlankI24  data 
)

Write a 24-bit int to the file (i.e., 3 bytes).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteLine ( PlankFileRef  p,
const char *  text 
)

Write line of text to the file.

This writes until it hits the first null character in the string and adds carriage return and line feed characters.

Parameters:
pThe Plank File object.
textThe string to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteLL ( PlankFileRef  p,
PlankLL  data 
)

Write a long to the file.

This will be a 32-bit int on 32-bit systems (i.e., 4 bytes) and a 64-bit int on 64-bit systems (i.e., 8 bytes) even on Windows where a 'long' is normally 32 bits on both architectures.

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful. Write a 64-bit int to the file.
Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteS ( PlankFileRef  p,
short  data 
)

Write a short to the file (16-bit int).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteString ( PlankFileRef  p,
const char *  text 
)

Write string to the file.

This writes until it hits the first null character in the string.

Parameters:
pThe Plank File object.
textThe string to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteUC ( PlankFileRef  p,
unsigned char  data 
)

Write one unsigned byte to the file.

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteUI ( PlankFileRef  p,
unsigned int  data 
)

Write an unsigned int to the file (32-bit int).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteUI24 ( PlankFileRef  p,
PlankUI24  data 
)

Write an unsigned 24-bit int to the file (i.e., 3 bytes).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteUL ( PlankFileRef  p,
PlankUL  data 
)

Write an unisigned long to the file.

This will be a 32-bit int on 32-bit systems (i.e., 4 bytes) and a 64-bit int on 64-bit systems (i.e., 8 bytes) even on Windows where a 'long' is normally 32 bits on both architectures.

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteULL ( PlankFileRef  p,
PlankULL  data 
)

Write an unsigned 64-bit int to the file.

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_File_WriteUS ( PlankFileRef  p,
unsigned short  data 
)

Write an unsigned short to the file (16-bit int).

Parameters:
pThe Plank File object.
dataThe value to write.
Returns:
A result code which will be PlankResult_OK if the operation was completely successful.
PlankResult pl_FileErase ( const char *  filepath)

Delete a file with the given path form the filesystem.

 All Classes Functions Typedefs Enumerations Enumerator Properties