nFileServer2 Class Reference
[File I/O and File System Access]
#include <nfileserver2.h>
Inheritance diagram for nFileServer2:

Detailed Description
Central server object of Nebula2's file system subsystem. Provides functions for creating file and directory objects and assigns.Please note that Nebula no longer knows the concept of a current working directory!
See also nFileServer2 Script Interface
(C) 2002 RadonLabs GmbH
Definition at line 31 of file nfileserver2.h.
Public Member Functions | |
| nFileServer2 () | |
| constructor | |
| virtual | ~nFileServer2 () |
| destructor | |
| bool | SetAssign (const nString &assignName, const nString &pathName) |
| sets a path alias | |
| nString | GetAssign (const nString &assignName) |
| gets a path alias | |
| void | ResetAssigns () |
| Reset assign repository to default values. | |
| nString | ManglePath (const nString &pathName) |
| expand path alias to real path | |
| virtual bool | MakePath (const nString &path) |
| make path components | |
| virtual bool | CopyFile (const nString &from, const nString &to) |
| copy a file | |
| virtual bool | DeleteFile (const nString &filename) |
| delete a file | |
| virtual bool | DeleteDirectory (const nString &dirName) |
| delete an empty directory | |
| virtual bool | Checksum (const nString &filename, uint &crc) |
| compute the Crc checksum for a file | |
| virtual void | SetFileReadOnly (const nString &filename, bool readOnly) |
| set read only status of a file | |
| virtual bool | IsFileReadOnly (const nString &filename) |
| get read only status of a file | |
| virtual nArray< nString > | ListFiles (const nString &dirName) |
| list all files in a directory (ignores directories) | |
| virtual nArray< nString > | ListMatchingFiles (const nString &dirName, const nString &pattern) |
| list files in a directory matching pattern | |
| virtual nArray< nString > | ListDirectories (const nString &dirName) |
| list all subdirs in a directory (ignores files) | |
| virtual nArray< nString > | ListMatchingDirectories (const nString &dirName, const nString &pattern) |
| list subdirs in a directory matching pattern | |
| virtual bool | FileExists (const nString &pathName) const |
| check if file exists | |
| virtual int | GetFileSize (const nString &pathName) const |
| get file size | |
| virtual bool | DirectoryExists (const nString &pathName) const |
| check if directory exists | |
| virtual nFileTime | GetFileWriteTime (const nString &pathName) |
| return the time stamp when file was last written to | |
| virtual nDirectory * | NewDirectoryObject () const |
| creates a new nDirectory object | |
| virtual nFile * | NewFileObject () const |
| creates a new nFile object | |
| virtual nFileNode * | CreateFileNode (const nString &name) |
| creates a file node (only useful for scripting languages) | |
| void | ResetStatistics () |
| reset statistics | |
| void | AddBytesRead (int b) |
| add read bytes | |
| void | AddBytesWritten (int b) |
| add written bytes | |
| void | AddSeek () |
| add seek operation to stats | |
| int | GetBytesRead () const |
| get bytes read since last reset | |
| int | GetBytesWritten () const |
| get bytes written since last reset | |
| int | GetNumSeeks () const |
| get number of seeks | |
Static Public Member Functions | |
| static nFileServer2 * | Instance () |
| get instance pointer | |
Protected Member Functions | |
| void | CleanupPathName (nString &str) |
| cleanup a path name in place | |
Constructor & Destructor Documentation
|
|
constructor history:
Definition at line 33 of file nfileserver2_main.cc. |
|
|
destructor history:
Definition at line 61 of file nfileserver2_main.cc. |
Member Function Documentation
|
|
get instance pointer
Definition at line 132 of file nfileserver2.h. |
|
||||||||||||
|
sets a path alias creates new or modifies existing assign under /sys/share/assigns
Definition at line 78 of file nfileserver2_main.cc. |
|
|
gets a path alias queries existing assign under /sys/share/assigns
Definition at line 109 of file nfileserver2_main.cc. |
|
|
Reset assign repository to default values. Remove all existing assigns and setup base assigns. Definition at line 125 of file nfileserver2_main.cc. |
|
|
expand path alias to real path Expands assign in path to full absolute path, replaces any backslashes by slashes, removes any trailing slash, and makes the path absolute. Please note that Nebula does not know the concept of a current working directory, thus, all paths MUST be absolute (please note that Nebula assigns can be used to create position independent absolute paths).
Definition at line 205 of file nfileserver2_main.cc. |
|
|
make path components Make any missing directories in path. Definition at line 560 of file nfileserver2_main.cc. |
|
||||||||||||
|
copy a file Copy a file. FIXME: the Non-Win32 version reads the entire file is into RAM!
Definition at line 620 of file nfileserver2_main.cc. |
|
|
delete a file Delete a file. Definition at line 704 of file nfileserver2_main.cc. |
|
|
delete an empty directory Delete an empty directory. Definition at line 722 of file nfileserver2_main.cc. |
|
||||||||||||
|
compute the Crc checksum for a file Compute the CRC checksum for a file. FIXME: the current implementation loads the entire file into memory.
Definition at line 766 of file nfileserver2_main.cc. |
|
||||||||||||
|
set read only status of a file Set the read-only status of a file. Definition at line 800 of file nfileserver2_main.cc. |
|
|
get read only status of a file Get the read-only status of a file. If the file does not exist, the routine returns false. Definition at line 843 of file nfileserver2_main.cc. |
|
|
list all files in a directory (ignores directories) List all files in a directory, ignores subdirecories. Definition at line 874 of file nfileserver2_main.cc. |
|
||||||||||||
|
list files in a directory matching pattern List all files in a directory matching given pattern, ignores subdirectories. Definition at line 899 of file nfileserver2_main.cc. |
|
|
list all subdirs in a directory (ignores files) List all subdirectories in a directory, ignores files. Definition at line 924 of file nfileserver2_main.cc. |
|
||||||||||||
|
list subdirs in a directory matching pattern List all subdirectories in a directory matching the given pattern, ignores files. Definition at line 949 of file nfileserver2_main.cc. |
|
|
check if file exists
Definition at line 506 of file nfileserver2_main.cc. |
|
|
get file size
Definition at line 523 of file nfileserver2_main.cc. |
|
|
check if directory exists
Definition at line 541 of file nfileserver2_main.cc. |
|
|
return the time stamp when file was last written to Returns the timestamp when the file was last written to. If the file doesn't exist, a default nFileTime object will be returned. Definition at line 975 of file nfileserver2_main.cc. |
|
|
creates a new nDirectory object creates a new nDirectory object
Reimplemented in nNpkFileServer. Definition at line 242 of file nfileserver2_main.cc. |
|
|
creates a new nFile object creates a new nFile object
Reimplemented in nNpkFileServer, and nRamFileServer. Definition at line 259 of file nfileserver2_main.cc. |
|
|
creates a file node (only useful for scripting languages) Create a filenode and return its full path name. A filenode is a nFile object wrapped into a nRoot subclass. It offers access to filesystem functionality for scripting languages which don't offer access to the host filesystem (like MicroTcl). Definition at line 743 of file nfileserver2_main.cc. |
|
|
reset statistics Reset statistics. Definition at line 144 of file nfileserver2.h. |
|
|
add read bytes Add read bytes to statistics. Definition at line 157 of file nfileserver2.h. |
|
|
add written bytes Add read bytes written to statistics. Definition at line 168 of file nfileserver2.h. |
|
|
add seek operation to stats Add a seek op to stats. Definition at line 179 of file nfileserver2.h. |
|
|
get bytes read since last reset Get bytes read since last ResetStatistics() Definition at line 190 of file nfileserver2.h. |
|
|
get bytes written since last reset Get bytes written since last ResetStatistics() Definition at line 201 of file nfileserver2.h. |
|
|
get number of seeks Get number of seeks since last ResetStatistics(). Definition at line 212 of file nfileserver2.h. |
|
|
cleanup a path name in place Returns a cleaned up path name (replaces backslashes with slashes, and removes trailing slash if exists. Definition at line 135 of file nfileserver2_main.cc. |
The documentation for this class was generated from the following files: