FileServer Class Reference
[Kernel Module]

#include <fileserver.h>

Inheritance diagram for FileServer:

RootServer< FileServer > Root Server< FileServer > Object TreeNode< Root > Referenced Counted Serialized List< Root > ListNode< Root >

List of all members.

Detailed Description

Central server object of file system. Provides functions for creating file and directory objects and assigns.

Public Member Functions

 FileServer (const char *id)
virtual ~FileServer ()
bool SetAssign (const string &assign, const string &path)
const char * GetAssign (const string &assign)
void ResetAssigns ()
bool ManglePath (const string &path, string &full_path)
DirectoryNewDirectory () const
FileNewFile () const
bool IsStandartStream (const File *file) const
bool FileExists (const string &path) const
bool DirectoryExists (const string &path) const
bool CopyFileEx (const string &from, const string &to)
bool Checksum (const string &file_name, uint_t &crc)
bool CreatePath (const string &path)
bool DeleteFileEx (const string &file_name)
bool DeleteDirectory (const string &dir_name)
bool ListFiles (vector< string > &file_list, const string &dir_name)
bool ListDirectories (vector< string > &file_list, const string &dir_name, bool special=false)

Static Public Member Functions

static void CleanupPath (string &path)
static void ExtractDirectory (const string &path, string &dir)
static void ExtractFile (const string &path, string &file)
static void ExtractFileName (const string &path, string &file_name)
static void ExtractExtension (const string &path, string &extension)
static FileGetStdIn ()
static FileGetStdOut ()
static FileGetStdErr ()

Protected Member Functions

void InitAssigns ()
void InitAppAssign ()
void InitUserAssign ()

Protected Attributes


Static Protected Attributes

static File std_in
static File std_out
static File std_err

Constructor & Destructor Documentation

FileServer::FileServer ( const char *  id  ) 


FileServer::~FileServer (  )  [virtual]


Member Function Documentation

bool FileServer::SetAssign ( const string &  assign,
const string &  path 

Creates new or modifies existing assign under /sys/assigns.

assign The name of the assign.
path The path to which the assign links.

const char * FileServer::GetAssign ( const string &  assign  ) 

Queries existing assign under /sys/assigns.

assign The name of the assign.
The path to which the assign links, or NULL if assign is undefined.

void FileServer::ResetAssigns (  ) 

Remove all existing assigns and setup base assigns.

bool FileServer::ManglePath ( const string &  path,
string &  full_path 

Expands assign in path to full absolute path, replaces any backslashes by slashes, removes any trailing slash, and makes the path absolute.

path The path to expand.
full_path Expanded path.
True if successful.

void FileServer::CleanupPath ( string &  path  )  [static]

Returns a cleaned up path name (replaces backslashes with slashes, and removes trailing slash if exists.

void FileServer::ExtractDirectory ( const string &  path,
string &  dir 
) [static]

void FileServer::ExtractFile ( const string &  path,
string &  file 
) [static]

void FileServer::ExtractFileName ( const string &  path,
string &  file_name 
) [static]

void FileServer::ExtractExtension ( const string &  path,
string &  extension 
) [static]

Directory * FileServer::NewDirectory (  )  const [inline]

Creates a new Directory object.

The Directory object.

File * FileServer::NewFile (  )  const [inline]

Creates a new File object.

The File object.

File * FileServer::GetStdIn (  )  [inline, static]

Returns wrapper of standart input.

Wrapper of standart input.

File * FileServer::GetStdOut (  )  [inline, static]

Returns wrapper of standart output.

Wrapper of standart input.

File * FileServer::GetStdErr (  )  [inline, static]

Returns wrapper of standart error output.

Wrapper of standart input.

bool FileServer::IsStandartStream ( const File file  )  const [inline]

Check if given file is a wrapper of standart stream.

True if file is a wrapper of standart stream.

bool FileServer::FileExists ( const string &  path  )  const

Check if file exists.

bool FileServer::DirectoryExists ( const string &  path  )  const

Check if directory exists.

bool FileServer::CopyFileEx ( const string &  from,
const string &  to 

bool FileServer::Checksum ( const string &  file_name,
uint_t crc 

bool FileServer::CreatePath ( const string &  path  ) 

bool FileServer::DeleteFileEx ( const string &  file_name  ) 

bool FileServer::DeleteDirectory ( const string &  dir_name  ) 

bool FileServer::ListFiles ( vector< string > &  file_list,
const string &  dir_name 

bool FileServer::ListDirectories ( vector< string > &  file_list,
const string &  dir_name,
bool  special = false 

void FileServer::InitAssigns (  )  [protected]

Initializes all default assigns.

void FileServer::InitAppAssign (  )  [protected]

Initialize home directory assign ("home:").

void FileServer::InitUserAssign (  )  [protected]

Initialize the user assign. This is where the application should save any type of data, like save games or config options, since applications may not have write access to the home: directory (which is by tradition the application directory).

Member Data Documentation

Root* FileServer::assigns [protected]

File FileServer::std_in [static, protected]

File FileServer::std_out [static, protected]

File FileServer::std_err [static, protected]

The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:31 2007 for Dark Oberon by  doxygen 1.5.3