Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

Platform_Win32_FileSystem_File Class Reference

Inheritance diagram for Platform_Win32_FileSystem_File:

Platform_FileSystem_File

List of all members.


Public Member Functions

 Platform_Win32_FileSystem_File (const char *path)
virtual ~Platform_Win32_FileSystem_File ()
virtual const char * GetPath ()
virtual bool Exists ()
virtual bool Create ()
virtual bool Open ()
virtual bool Close ()
virtual void Delete ()
virtual int GetPosition ()
virtual int SetPosition (int position, SetPositionOrigin origin)
virtual int Write (const char *value, int count=1)
virtual int Write (const short *value, int count=1)
virtual int Write (const int *value, int count=1)
virtual int Write (const long *value, int count=1)
virtual int Write (const unsigned char *value, int count=1)
virtual int Write (const unsigned short *value, int count=1)
virtual int Write (const unsigned int *value, int count=1)
virtual int Write (const unsigned long *value, int count=1)
virtual int Write (const float *value, int count=1)
virtual int Write (const double *value, int count=1)
virtual int Write (const bool *value, int count=1)
virtual int Read (char *value, int count=1)
virtual int Read (short *value, int count=1)
virtual int Read (int *value, int count=1)
virtual int Read (long *value, int count=1)
virtual int Read (unsigned char *value, int count=1)
virtual int Read (unsigned short *value, int count=1)
virtual int Read (unsigned int *value, int count=1)
virtual int Read (unsigned long *value, int count=1)
virtual int Read (float *value, int count=1)
virtual int Read (double *value, int count=1)
virtual int Read (bool *value, int count=1)

Detailed Description

Author:
Mattias Gustavsson

Definition at line 20 of file Platform_Win32_FileSystem_File.h.


Constructor & Destructor Documentation

Platform_Win32_FileSystem_File::Platform_Win32_FileSystem_File ( const char *  path  ) 

Definition at line 14 of file Platform_Win32_FileSystem_File.cpp.

Platform_Win32_FileSystem_File::~Platform_Win32_FileSystem_File (  )  [virtual]

Definition at line 33 of file Platform_Win32_FileSystem_File.cpp.


Member Function Documentation

const char * Platform_Win32_FileSystem_File::GetPath (  )  [virtual]

Retrieves the path specified when this file object was created

Returns:
The path for the file object

Implements Platform_FileSystem_File.

Definition at line 49 of file Platform_Win32_FileSystem_File.cpp.

bool Platform_Win32_FileSystem_File::Exists (  )  [virtual]

Checks if the file which this file object represents exists.

Returns:
True if the file exists, false if it doesn't

Implements Platform_FileSystem_File.

Definition at line 57 of file Platform_Win32_FileSystem_File.cpp.

bool Platform_Win32_FileSystem_File::Create (  )  [virtual]

Creates the file which this file object represent. If it already exists, it will be replaced. The file is then left open for writing, and should be closed by a call to Close.

Returns:
True if the file was successfully created, false if there was an error

Implements Platform_FileSystem_File.

Definition at line 79 of file Platform_Win32_FileSystem_File.cpp.

bool Platform_Win32_FileSystem_File::Open (  )  [virtual]

Opens the file which this file object represent, leaving it ready for reading from. When done, it should be closed by a call to Close.

Returns:
True if the file was successfully opened, false if there was an error

Implements Platform_FileSystem_File.

Definition at line 94 of file Platform_Win32_FileSystem_File.cpp.

bool Platform_Win32_FileSystem_File::Close (  )  [virtual]

Close a file which was opened for reading by a call to Open, or for writing by a call to Create.

Returns:
True if the file was successfully closed, false if there was an error

Implements Platform_FileSystem_File.

Definition at line 109 of file Platform_Win32_FileSystem_File.cpp.

void Platform_Win32_FileSystem_File::Delete (  )  [virtual]

Deletes the file which this file object represent, if it exists.

Implements Platform_FileSystem_File.

Definition at line 125 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::GetPosition (  )  [virtual]

Retrieves the current read or write position of a file which is currently open for reading or writing, respectively. The returned position is relative to the start of the file.

Returns:
The current position of the file

Implements Platform_FileSystem_File.

Definition at line 136 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::SetPosition ( int  position,
SetPositionOrigin  origin 
) [virtual]

Sets the read or write position of a file which is currently open for reading or writing, respectively. The specified position can be relative to the current position, the start of the file or the end of the file, as specified.

Returns:
The new position

Implements Platform_FileSystem_File.

Definition at line 149 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const char *  value,
int  count = 1 
) [virtual]

Writes the specified values to the file. Endianness is handled automatically by the platform-specific implementation, such that everything is written to file as little endian. This is to ensure binary file compatibility across platforms.

Parameters:
value Pointer to the value(s) which is to be written
count Number of values to write
Returns:
The number of values that was successfully written

Implements Platform_FileSystem_File.

Definition at line 212 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const short *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 217 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const int *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 222 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const long *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 227 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const unsigned char *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 232 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const unsigned short *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 237 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const unsigned int *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 242 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const unsigned long *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 247 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const float *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 252 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const double *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 257 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Write ( const bool *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 262 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( char *  value,
int  count = 1 
) [virtual]

Reads the specified number of values from the file, into the specified memory area. Endianness is handled automatically by the platform-specific implementation, assuming that values stored in the file are all little endian. This is to ensure binary file compatibility across platforms.

Parameters:
value Pointer to the memory where the values are to be read
count Number of values to read
Returns:
The number of values that was successfully read

Implements Platform_FileSystem_File.

Definition at line 299 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( short *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 304 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( int *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 309 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( long *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 314 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( unsigned char *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 319 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( unsigned short *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 324 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( unsigned int *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 329 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( unsigned long *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 334 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( float *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 339 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( double *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 344 of file Platform_Win32_FileSystem_File.cpp.

int Platform_Win32_FileSystem_File::Read ( bool *  value,
int  count = 1 
) [virtual]

Implements Platform_FileSystem_File.

Definition at line 349 of file Platform_Win32_FileSystem_File.cpp.



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.