Encapsulates a file, providing a platform independent interface. More...
#include <xsfile.h>
Public Attributes | |
FILE * | m_handle |
Related Functions | |
(Note that these are not member functions.) | |
XsResultValue | XsFile_close (struct XsFile *thisPtr) |
Closes the file. More... | |
XsResultValue | XsFile_create (struct XsFile *thisPtr, const struct XsString *filename, int writeOnly) |
Creates a new binary file with name filename, contents of existing files will be discarded. More... | |
XsResultValue | XsFile_createText (struct XsFile *thisPtr, const struct XsString *filename, int writeOnly) |
Creates a new text file with name filename, contents of existing files will be discarded. More... | |
void | XsFile_destruct (struct XsFile *thisPtr) |
Frees the resources of this object by closing the file if it is open. More... | |
int | XsFile_eof (struct XsFile const *thisPtr) |
XsResultValue | XsFile_erase (const struct XsString *filename) |
Deletes a file with name filename. More... | |
XsResultValue | XsFile_error (struct XsFile const *thisPtr) |
int | XsFile_exists (const struct XsString *filename) |
Checks if the file exists (can be accessed) More... | |
XsResultValue | XsFile_flush (struct XsFile *thisPtr) |
Writes unwritten data to the file. More... | |
XsResultValue | XsFile_fullPath (const struct XsString *filename, struct XsString *fullPath) |
Retrieves the full path for a filename. More... | |
int | XsFile_getc (struct XsFile *thisPtr) |
Gets and returns the next byte from a file. More... | |
XsResultValue | XsFile_getline (struct XsFile *thisPtr, struct XsString *line) |
Reads a full line from the file. More... | |
char * | XsFile_gets (struct XsFile *thisPtr, char *str, int num) |
Reads characters from this file and stores them into str until (num-1) characters have been read or either a newline or the end-of-file is reached, whichever happens first. More... | |
FILE * | XsFile_handle (struct XsFile *thisPtr) |
int | XsFile_isOpen (const struct XsFile *thisPtr) |
Checks if a file is open. More... | |
XsResultValue | XsFile_open (struct XsFile *thisPtr, const struct XsString *filename, int readOnly) |
Opens an existing binary file with name filename. More... | |
XsResultValue | XsFile_openText (struct XsFile *thisPtr, const struct XsString *filename, int readOnly) |
Opens an existing binary file with name filename. More... | |
XsResultValue | XsFile_putc (struct XsFile *thisPtr, int character) |
Writes a character to the file. More... | |
XsResultValue | XsFile_puts (struct XsFile *thisPtr, const char *str) |
Writes a null terminated c-string to the file. More... | |
XsFilePos | XsFile_read (struct XsFile *thisPtr, void *destination, XsFilePos size, XsFilePos count) |
Reads a number of elements from a file. More... | |
XsResultValue | XsFile_reopen (struct XsFile *thisPtr, const struct XsString *filename, const struct XsString *mode) |
Reopens a file. More... | |
XsResultValue | XsFile_resize (struct XsFile *thisPtr, XsFilePos fileSize) |
Resizes the file to fileSize bytes. More... | |
XsResultValue | XsFile_seek (struct XsFile *thisPtr, XsFilePos offset) |
Moves the current file position relative to the start of the file. More... | |
XsResultValue | XsFile_seek_r (struct XsFile *thisPtr, XsFilePos offset) |
Moves the current file position relative to the end of the file. More... | |
XsFilePos | XsFile_tell (struct XsFile const *thisPtr) |
Returns the current position in the file. More... | |
XsResultValue | XsFile_truncate (struct XsFile *thisPtr, XsFilePos fileSize) |
Reduces the file to a maximum size of fileSize bytes. More... | |
XsFilePos | XsFile_write (struct XsFile *thisPtr, const void *source, XsFilePos size, XsFilePos count) |
Writes a number of elements to a file. More... | |
Encapsulates a file, providing a platform independent interface.