The Nebula Device 3: Win360::Win360FSWrapper Class Reference

The Nebula Device 3

Win360::Win360FSWrapper Class Reference

#include <win360fswrapper.h>

Inheritance diagram for Win360::Win360FSWrapper:

IO::FSWrapper

Detailed Description

Internal filesystem wrapper for Win32/Xbox360. All paths must be native paths (i.e. not contain Nebula assigns).

(C) 2007 Radon Labs GmbH

Static Public Member Functions

static Handle OpenFile (const Util::String &path, IO::Stream::AccessMode accessMode, IO::Stream::AccessPattern accessPattern, DWORD flagsAndAttributes=0)
 open a file
static void CloseFile (Handle h)
 close a file
static void Write (Handle h, const void *buf, IO::Stream::Size numBytes)
 write to a file
static IO::Stream::Size Read (Handle h, void *buf, IO::Stream::Size numBytes)
 read from a file
static void Seek (Handle h, IO::Stream::Offset offset, IO::Stream::SeekOrigin orig)
 seek in a file
static IO::Stream::Position Tell (Handle h)
 get position in file
static void Flush (Handle h)
 flush a file
static bool Eof (Handle h)
 return true if at end-of-file
static IO::Stream::Size GetFileSize (Handle h)
 get size of a file in bytes
static void SetReadOnly (const Util::String &path, bool readOnly)
 set read-only status of a file
static bool IsReadOnly (const Util::String &path)
 get read-only status of a file
static bool DeleteFile (const Util::String &path)
 delete a file
static bool DeleteDirectory (const Util::String &path)
 delete an empty directory
static bool FileExists (const Util::String &path)
 return true if a file exists
static bool DirectoryExists (const Util::String &path)
 return true if a directory exists
static void SetFileWriteTime (const Util::String &path, IO::FileTime fileTime)
 set the write-access time stamp of a file
static IO::FileTime GetFileWriteTime (const Util::String &path)
 get the last write-access time stamp of a file
static bool CreateDirectory (const Util::String &path)
 create a directory
static Util::Array< Util::StringListFiles (const Util::String &dirPath, const Util::String &pattern)
 list all files in a directory
static Util::Array< Util::StringListDirectories (const Util::String &dirPath, const Util::String &pattern)
 list all subdirectories in a directory
static Util::String GetUserDirectory ()
 get path to the current user's home directory (for user: standard assign)
static Util::String GetAppDataDirectory ()
 get path to the current user's appdata directory (for appdata: standard assign)
static Util::String GetTempDirectory ()
 get path to the current user's temp directory (for temp: standard assign)
static Util::String GetHomeDirectory ()
 get path to the current application directory (for home: standard assign)
static Util::String GetBinDirectory ()
 get path to the current bin directory (for bin: standard assign)
static Util::String GetProgramsDirectory ()
 get path to the "c:/program files" directory
static bool IsDeviceName (const Util::String &str)
 return true when the string is a device name (e.g. "C:")

Member Function Documentation

Win360FSWrapper::Handle Win360::Win360FSWrapper::OpenFile ( const Util::String path,
IO::Stream::AccessMode  accessMode,
IO::Stream::AccessPattern  accessPattern,
DWORD  flagsAndAttributes = 0 
) [static]

open a file

Open a file using the Xbox360 function CreateFile(). Returns a handle to the file which must be passed to the other Win360FSWrapper file methods. If opening the file fails, the function will return 0. The filename must be a native Xbox360 path (no assigns, etc...).

void Win360::Win360FSWrapper::CloseFile ( Handle  handle  )  [static]

close a file

Closes a file opened by Win360FSWrapper::OpenFile().

Stream::Position Win360::Win360FSWrapper::Tell ( Handle  handle  )  [static]

get position in file

Get current position in file.

void Win360::Win360FSWrapper::Flush ( Handle  handle  )  [static]

flush a file

Flush unwritten data to file.

bool Win360::Win360FSWrapper::Eof ( Handle  handle  )  [static]

return true if at end-of-file

Returns true if current position is at end of file.

Stream::Size Win360::Win360FSWrapper::GetFileSize ( Handle  handle  )  [static]

get size of a file in bytes

Returns the size of a file in bytes.

void Win360::Win360FSWrapper::SetReadOnly ( const Util::String path,
bool  readOnly 
) [static]

set read-only status of a file

Set the read-only status of a file. This method does nothing on the Xbox360.

bool Win360::Win360FSWrapper::IsReadOnly ( const Util::String path  )  [static]

get read-only status of a file

Get the read-only status of a file. This method always returns true on the Xbox360.

bool Win360::Win360FSWrapper::DeleteFile ( const Util::String path  )  [static]

delete a file

Deletes a file. Returns true if the operation was successful. The delete will fail if the fail doesn't exist or the file is read-only.

bool Win360::Win360FSWrapper::DeleteDirectory ( const Util::String path  )  [static]

delete an empty directory

Delete an empty directory. Returns true if the operation was successful.

bool Win360::Win360FSWrapper::FileExists ( const Util::String path  )  [static]

return true if a file exists

Return true if a file exists.

bool Win360::Win360FSWrapper::DirectoryExists ( const Util::String path  )  [static]

return true if a directory exists

Return true if a directory exists.

void Win360::Win360FSWrapper::SetFileWriteTime ( const Util::String path,
IO::FileTime  fileTime 
) [static]

set the write-access time stamp of a file

Set the write-access time stamp of a file.

FileTime Win360::Win360FSWrapper::GetFileWriteTime ( const Util::String path  )  [static]

get the last write-access time stamp of a file

Return the last write-access time to a file.

bool Win360::Win360FSWrapper::CreateDirectory ( const Util::String path  )  [static]

create a directory

Creates a new directory.

Array< String > Win360::Win360FSWrapper::ListFiles ( const Util::String dirPath,
const Util::String pattern 
) [static]

list all files in a directory

Lists all files in a directory, filtered by a pattern.

Array< String > Win360::Win360FSWrapper::ListDirectories ( const Util::String dirPath,
const Util::String pattern 
) [static]

list all subdirectories in a directory

Lists all subdirectories in a directory, filtered by a pattern. This will not return the special directories ".." and ".".

String Win360::Win360FSWrapper::GetUserDirectory (  )  [static]

get path to the current user's home directory (for user: standard assign)

NOTE: The user: standard assign is not supported on the 360.

String Win360::Win360FSWrapper::GetAppDataDirectory (  )  [static]

get path to the current user's appdata directory (for appdata: standard assign)

NOTE: The appdata: standard assign is not supported on the 360.

String Win360::Win360FSWrapper::GetTempDirectory (  )  [static]

get path to the current user's temp directory (for temp: standard assign)

NOTE: The temp standard assign is not supported on the 360 (only on Devkits!)

String Win360::Win360FSWrapper::GetHomeDirectory (  )  [static]

get path to the current application directory (for home: standard assign)

This method should return the installation directory of the application.

String Win360::Win360FSWrapper::GetBinDirectory (  )  [static]

get path to the current bin directory (for bin: standard assign)

This method sould return the directory where the application executable is located.

String Win360::Win360FSWrapper::GetProgramsDirectory (  )  [static]

get path to the "c:/program files" directory

NOTE: The programs: standard assign is not supported on the 360.

bool Win360::Win360FSWrapper::IsDeviceName ( const Util::String str  )  [static]

return true when the string is a device name (e.g. "C:")

Return true if the provided string is a device name.