Linderdaum Engine: clFileSystem Class Reference
Updated: Sun Feb 5 2012 22:59:50
clFileSystem Class Reference

Virtual File System interface providing I/O facilities. More...

#include <FileSystem.h>

List of all members.

Public Member Functions

 EXCEPTION (clExcept_UnableToFindFile,"Unable to find file")
 EXCEPTION (clExcept_UnableToReadFileTime,"Unable to read file time")
 EXCEPTION (clExcept_UnableToMountNonexistentPath,"Unable to mount nonexistent path")
 EXCEPTION (clExcept_UnableToParseXLMLScript,"Unable to parse XLML script")
 clFileSystem ()
virtual ~clFileSystem ()
virtual void AfterConstruction ()
scriptmethod iIStreamCreateFileReader (const LString &FileName) const
scriptmethod iOStreamCreateFileWriter (const LString &FileName) const
scriptmethod iIStreamCreateFileReaderFromString (const LString &FileName, const LString &VirtualFileName, const LString &Str) const
scriptmethod iIStreamCreateFileReaderFromMemory (const LString &FileName, const LString &VirtualFileName, const void *BufPtr, Luint64 BufSize) const
scriptmethod iOStreamCreateLogFileWriter () const
 Create the output stream which writes text lines to engine.log.
scriptmethod clMemFileWriterCreateMemFileWriter (const LString &FileName, Luint64 InitialSize) const
 Create the in-mem output stream (used for decompression/downloading)
scriptmethod bool DeleteFilePhys (const LString &FileName)
 Delete physical file.
scriptmethod LString CreateTempFileName (const LString &BaseDirectory, const LString &Prefix, bool RequireUnique) const
 Create unique temp file name using system API. RequireUnique creates new file and ensures ownership.
scriptmethod void CreateDirs (const LString &DirectoryName) const
 Create every non-existent (virtual or physical) directory in the DirectoryName path.
scriptmethod void Mount (const LString &PhysicalPath)
 Add new mount point.
scriptmethod void Unmount (const LString &ThePath)
 Remove the mount point.
scriptmethod void AddAliasMountPoint (const LString &SrcPath, const LString &AliasPrefix)
 Add virtual mount point To allow mounting "App.apk:assets/Data" we provide alias mount points.
scriptmethod void AddMountPoint (iMountPoint *MP)
 Manually add the mount point.
scriptmethod void RemoveMountPoint (iMountPoint *MP)
 Manually remove the mount point.
scriptmethod size_t GetNumMountPoints () const
 Get total number of used mount points.
scriptmethod iMountPointGetMountPoint (size_t Idx) const
 Get mount point by index.
scriptmethod iMountPointFindMountPointByName (const LString &ThePath)
 Get mount point by its name (dir/archive)
scriptmethod void SetRootDir (const LString &RootDir)
 Set the root directory name for the virtual system.
scriptmethod LString VirtualNameToPhysical (const LString &Path) const
 Convert internal file name to system path.
scriptmethod LString VirtualNameToPhysicalFull (const LString &Path) const
 Convert internal file name to full system path.
scriptmethod bool FileExists (const LString &Name) const
 Check if the virtual file name corresponds to some physical file in one of the mount points.
scriptmethod bool FileExistsInResource (const LString &Name) const
 Check if the virtual file name RESOURCE:filename corresponds to the actual resource.
scriptmethod bool FileExistsAndNewer (const LString &OldFile, const LString &NewFile) const
 Check if virtual file named NewFile exists and is newer than the virtual file named OldFile.
scriptmethod bool IsFullPath (const LString &Path) const
 Windows-specific check for the appearance of ":" symbol.
scriptmethod LString GetFullPath (const LString &PhysicalPath) const
 Convert relative physical path to absolute physical path.
scriptmethod Lint64 GetFileTime (const LString &FileName) const
 Get file modification date/time.
scriptmethod Lint64 GetMaxTimeForDirectory (const LString &DirName) const
 Determine latest modification date/time for the files in a given directory.
noexport bool CopyFile (const LString &Src, const LString &Dst) const
scriptmethod int DownloadFile (const LString &Server, int Port, const LString &Path, const LString &OutFile, float Timeout, iObject *CompletionHandler)
 Download file from "http://Server:Port/Path" to OutFile, Timeout is in seconds, 0 timeout means wait forever, return downloadID.
scriptmethod bool CancelDownload (int DownloadID)
 Cancel download in-progress. Return true if download was cancelled and false otherwise or if invalid DownloadID was specified.
scriptmethod clHTTPServerThreadStartWebServer (const LString &BindAddress, int BindPort, int MaxConn)
 Start a new instance of web server and attach it to the specified address allowing MaxConn simultaneous connections.
scriptmethod clDownloadThreadGetDownloadThread () const
 Manual control of the download thread.
bool LoadFileLinesArray (const LString &FName, LArray< LString > &Lines) const
 Load all lines from text file to LArray.
bool LoadFileLinesVec (const LString &FName, std::vector< LString > &Lines) const
 Load all lines from text file to std::vector.
bool SaveFileLinesArray (const LString &FName, const LArray< LString > &Lines) const
 Save an array of strings to file.
bool SaveFileLinesVec (const LString &FName, const std::vector< LString > &Lines) const
 Save a vector of strings to file.
bool LoadFileData (const LString &FName, void **Data, Luint64 *DataSize) const
 Load binary data to the newly allocated buffer.
bool SaveFileData (const LString &FName, const void *Data, Luint64 DataSize) const
 Save binary data to the file.
scriptmethod clBlobLoadFileAsBlob (const LString &FName) const
 Load binary data to the newly allocated buffer (Blob)
scriptmethod bool SaveBlobToFile (const LString &FName, clBlob *Blob) const
 Save blob to file.
scriptmethod Luint32 CRC32 (const void *Data, Luint64 DataSize) const
 Calculate zero-based CRC32 checksum (using libcompress)
scriptmethod Luint32 CRC32ForBlob (const clBlob *B) const
 Calculate zero-based CRC32 checksum (using libcompress)
scriptmethod mlNodeLoadXLMLFromStream_ASE (iIStream *IStream) const
 Create an hierarchy of nodes representing ASE-like XLML stream.
scriptmethod mlNodeLoadXLML_ASE (const LString &FileName) const
 Load an hierarchy of nodes representing input ASE-like XLML stream.
scriptmethod mlNodeLoadXLMLFromStream (iIStream *IStream) const
 Create an hierarchy of nodes representing input XLML stream (IStream)
scriptmethod mlNodeLoadXLML (const LString &FileName) const
 Load an hierarchy of nodes representing input XLML stream (input XLML stream type (XLML, BinaryML, or XML) is detected automatically from file extension)
scriptmethod mlNodeLoadXMLFromStream (iIStream *IStream) const
 Create an hierarchy of nodes representing input XLML stream (IStream)
scriptmethod mlNodeLoadXML (const LString &FileName) const
 Load an hierarchy of nodes representing input XLML stream (input XLML stream type (XLML, BinaryML, or XML) is detected automatically from file extension)
scriptmethod bool SaveXLML (mlNode *Node, const LString &FileName) const
 Save XLML representation of the mlNode tree.
scriptmethod bool SaveXLMLToStream (mlNode *Node, iOStream *OStream) const
 Save XLML representation of the mlNode tree to the output stream.
scriptmethod bool SaveXLMLToLog (mlNode *Node) const
 Save XLML representation of the mlNode tree to engine log.
scriptmethod bool SaveXMLToLog (mlNode *Node) const
 Save XML representation of the mlNode tree to engine log.
scriptmethod bool SaveXML (mlNode *Node, const LString &FileName) const
 Save XML representation of the mlNode tree.
scriptmethod bool SaveXMLToStream (mlNode *Node, iOStream *OStream) const
 Save XML representation of the mlNode tree to the output stream.
scriptmethod void EnumerateFiles (const LString &VirtualPath, bool SubDirs, LStr::clStringsVector *StrVec) const
scriptmethod void EnumerateDirs (const LString &VirtualPath, bool SubDirs, LStr::clStringsVector *StrVec) const
scriptmethod LString FindFile (const LString &FileName, const LString &ParentFileName)
scriptmethod iRAWFileCreatePhysicalFileReader (const LString &FileName, const LString &VirtualName) const
 creation of a physical file reader
scriptmethod iIStreamCreateFileMapperForRawFile (iRAWFile *RF) const
 Create file mapper and set its raw file.
scriptmethod Luint64 CompareFiles (const LString &FileName1, const LString &FileName2) const
 Compare two files. Returns 0 if files are equal or difference offset in the first file otherwise.
scriptmethod void SetUseVirtualFileNames (bool Use)
 Enable or disable usage of virtual file names.
scriptmethod bool GetUseVirtualFileNames () const
 Disable usage of virtual file names.
scriptmethod void Enumerate (const LString &VirtualPath, bool SubDirs, bool Files, bool SaveFullNames, LStr::clStringsVector *StrVec) const
 low-level file enumeration (uses FindFirst/FindNext or opendir(), depending on the platform)
scriptmethod void AddFileWatch (const LString &FileName, iObject *Handler)
 Add new file change/delete/rename notification.
scriptmethod void AddMultipleFileWatches (const LStr::clStringsVector &FileNames, iObject *Handler)
 Add a single handler for multiple file changes.
scriptmethod void StartDirectoryWatch (const LString &DirName, bool Recursive, iObject *Handler)
 Watch all files in the directory (using FS::Enumerate)
scriptmethod void AddDirWatch (const LString &DirName, bool Recursive)
 Add new dir change notification.
scriptmethod void RemoveFileWatch (const LString &FileName)
 Remove file change notification.
scriptmethod void RemoveDirWatch (const LString &DirName)
 Remove dir change notification.
scriptmethod void OpenURL (const LString &URL)
 open URL in a default web browser
scriptmethod void SetWallpaper (const LString &ImageFileName)
 set desktop wallpaper
scriptmethod void OpenImageDialog ()
 open image dialog
virtual void Event_POSTINIT (LEvent Event, const LEventArgs &Args)
void AddFileWatchC (const LString &Args)
void AddDirWatchC (const LString &Args)
void RemoveFileWatchC (const LString &Args)
void RemoveDirWatchC (const LString &Args)

Static Public Member Functions

static void CreateDirsPhys (const LString &DirectoryName)
 Create every non-existent (physical) directory in the DirectoryName path.
static bool FileExistsPhys (const LString &PhysicalName)
 Check if the physical file named "PhysicalName" exists.
static noexport void SplitPath (const LString &Path, LString *Drive, LString *Dir, LString *FileName, LString *FileExt)
static noexport LString ReplaceEnvVars (const LString &String)
static LString ValidatePath (LString PathName)

Public Attributes

 EXCEPTIONABLE
 declares this class capable of throwing exceptions

Private Member Functions

iMountPointFindMountPoint (const LString &FileName) const
 Search for a mount point for this file.
clMemRAWFileGetResourceStream (const LString &ResourceID, const LString &ResourceType) const
 Win32/Win64 OS-specific : access to resources embedded into the executable.
bool IsFatalOnErrors () const
 Do we throw exceptions in XLML parsing or not.
scriptmethod mlNodeLoadXLMLFromStream_Internal (iIStream *IStream, bool NonStrictASEMode) const
 Create an hierarchy of nodes representing XLML stream with different reading modes.
scriptmethod mlNodeLoadXLML_Internal (const LString &FileName, bool NonStrictASEMode) const
 Load an hierarchy of nodes representing input ASE-like XLML stream.
void DownloadFileC (const LString &Args)
void StartWebServerC (const LString &Args)
void StopWebServersC (const LString &Args)

Private Attributes

LArray< iMountPoint * > FMountPoints
 the list of active mount points
bool FUseVirtualFileNames
 use virtual file names with mount points (true by defaul)
clDownloadThreadFDownloadThread
 HTTP download thread. I just don't know where to put this.
clHTTPServerThreadFServerThread
 Can be more than one, no time to mess with pointers though.

Detailed Description

Virtual File System interface providing I/O facilities.

  • Abstract file access using URLs
  • Supports multiple mount points (converts virtual file names to physical)
  • Processes XML streams

Provides mount points for Win32 FAT file system. It supports not only ordinary directories, but also Win32/Win64 resources embedded into the executable, .RAR archives and has the possibility to hide a download from remote network site.

Utility functions can enumerate files in a virtual directory and create an XML/XLML parser for the file.

After the initialization a user can call multiple Mount("<directory_or_resource>") commands to add new mount points.

File access is done through unified stream interface (iIStream/iOStream classes)


Constructor & Destructor Documentation

clFileSystem::clFileSystem ( )
clFileSystem::~clFileSystem ( ) [virtual]

Member Function Documentation

void clFileSystem::AddAliasMountPoint ( const LString &  SrcPath,
const LString &  AliasPrefix 
)

Add virtual mount point To allow mounting "App.apk:assets/Data" we provide alias mount points.

Usage: VFS->Mount("App.apk") VFS->AddAliasMountPoint("App.apk", "assets/Data");

void clFileSystem::AddDirWatch ( const LString &  DirName,
bool  Recursive 
)

Add new dir change notification.

void clFileSystem::AddDirWatchC ( const LString &  Args)
void clFileSystem::AddFileWatch ( const LString &  FileName,
iObject Handler 
)

Add new file change/delete/rename notification.

void clFileSystem::AddFileWatchC ( const LString &  Args)

yes, I know. They must be private.

But we bind them in Console and unbind in ~Console, so we must have the access here. friend-class is not a good solution

void clFileSystem::AddMountPoint ( iMountPoint MP)

Manually add the mount point.

void clFileSystem::AddMultipleFileWatches ( const LStr::clStringsVector FileNames,
iObject Handler 
)

Add a single handler for multiple file changes.

void clFileSystem::AfterConstruction ( ) [virtual]

Reimplemented from iObject.

bool clFileSystem::CancelDownload ( int  DownloadID)

Cancel download in-progress. Return true if download was cancelled and false otherwise or if invalid DownloadID was specified.

Luint64 clFileSystem::CompareFiles ( const LString &  FileName1,
const LString &  FileName2 
) const

Compare two files. Returns 0 if files are equal or difference offset in the first file otherwise.

bool clFileSystem::CopyFile ( const LString &  Src,
const LString &  Dst 
) const
Luint32 clFileSystem::CRC32 ( const void *  Data,
Luint64  DataSize 
) const

Calculate zero-based CRC32 checksum (using libcompress)

Luint32 clFileSystem::CRC32ForBlob ( const clBlob B) const

Calculate zero-based CRC32 checksum (using libcompress)

void clFileSystem::CreateDirs ( const LString &  DirectoryName) const

Create every non-existent (virtual or physical) directory in the DirectoryName path.

void clFileSystem::CreateDirsPhys ( const LString &  DirectoryName) [static]

Create every non-existent (physical) directory in the DirectoryName path.

iIStream * clFileSystem::CreateFileMapperForRawFile ( iRAWFile RF) const

Create file mapper and set its raw file.

iIStream * clFileSystem::CreateFileReader ( const LString &  FileName) const

Create FileReader for the specified file name

  • Converts FileName to physical (OS-dependant) file name and
  • Supports Win32/Win64 resources embedded into the executable (Use "RESOURCE:<name>" string as a file name to get access to the "<name>" resource)
  • Supports unpacked .RAR files as the usual directories
iIStream * clFileSystem::CreateFileReaderFromMemory ( const LString &  FileName,
const LString &  VirtualFileName,
const void *  BufPtr,
Luint64  BufSize 
) const

Create a FileReader instance using BufPtr and BufSize parameters as a data source

Parameters:
FileName- user's file name
VirtualFileName- virtual file name provided for this "file"
BufPtr- data buffer with actual "file" contents
BufSize- size of data buffer
iIStream * clFileSystem::CreateFileReaderFromString ( const LString &  FileName,
const LString &  VirtualFileName,
const LString &  Str 
) const

Create a FileReader instance using Str parameter as a data source

Parameters:
FileName- user's file name
VirtualFileName- virtual file name provided for this "file"
Str- string with actual "file" contents
iOStream * clFileSystem::CreateFileWriter ( const LString &  FileName) const

Create FileWriter for the specified file name

  • Only physical files are supported ! (If the virtual FileName corresponds to .RAR archive or resource an error is produced)
iOStream * clFileSystem::CreateLogFileWriter ( ) const

Create the output stream which writes text lines to engine.log.

clMemFileWriter * clFileSystem::CreateMemFileWriter ( const LString &  FileName,
Luint64  InitialSize 
) const

Create the in-mem output stream (used for decompression/downloading)

iRAWFile * clFileSystem::CreatePhysicalFileReader ( const LString &  FileName,
const LString &  VirtualName 
) const

creation of a physical file reader

LString clFileSystem::CreateTempFileName ( const LString &  BaseDirectory,
const LString &  Prefix,
bool  RequireUnique 
) const

Create unique temp file name using system API. RequireUnique creates new file and ensures ownership.

bool clFileSystem::DeleteFilePhys ( const LString &  FileName)

Delete physical file.

int clFileSystem::DownloadFile ( const LString &  Server,
int  Port,
const LString &  Path,
const LString &  OutFile,
float  Timeout,
iObject CompletionHandler 
)

Download file from "http://Server:Port/Path" to OutFile, Timeout is in seconds, 0 timeout means wait forever, return downloadID.

void clFileSystem::DownloadFileC ( const LString &  Args) [private]
void clFileSystem::Enumerate ( const LString &  VirtualPath,
bool  SubDirs,
bool  Files,
bool  SaveFullNames,
LStr::clStringsVector StrVec 
) const

low-level file enumeration (uses FindFirst/FindNext or opendir(), depending on the platform)

void clFileSystem::EnumerateDirs ( const LString &  VirtualPath,
bool  SubDirs,
LStr::clStringsVector StrVec 
) const

Enumerate directories in a given VirtualPath

Parameters:
VirtualPath- path where the directories are enumerated
SubDirs- if true, then the searching recurses to subdirectories
StrVec- pointer to vector<> of string with output directories list
void clFileSystem::EnumerateFiles ( const LString &  VirtualPath,
bool  SubDirs,
LStr::clStringsVector StrVec 
) const

Enumerate directories in a given VirtualPath

Parameters:
VirtualPath- path where the directories are enumerated
SubDirs- if true, then the searching recurses to subdirectories
StrVec- pointer to vector<> of string with output files list
void clFileSystem::Event_POSTINIT ( LEvent  Event,
const LEventArgs Args 
) [virtual]
clFileSystem::EXCEPTION ( clExcept_UnableToParseXLMLScript  ,
"Unable to parse XLML script"   
)
clFileSystem::EXCEPTION ( clExcept_UnableToFindFile  ,
"Unable to find file"   
)
clFileSystem::EXCEPTION ( clExcept_UnableToReadFileTime  ,
"Unable to read file time"   
)
clFileSystem::EXCEPTION ( clExcept_UnableToMountNonexistentPath  ,
"Unable to mount nonexistent path"   
)
bool clFileSystem::FileExists ( const LString &  Name) const

Check if the virtual file name corresponds to some physical file in one of the mount points.

bool clFileSystem::FileExistsAndNewer ( const LString &  OldFile,
const LString &  NewFile 
) const

Check if virtual file named NewFile exists and is newer than the virtual file named OldFile.

bool clFileSystem::FileExistsInResource ( const LString &  Name) const

Check if the virtual file name RESOURCE:filename corresponds to the actual resource.

bool clFileSystem::FileExistsPhys ( const LString &  PhysicalName) [static]

Check if the physical file named "PhysicalName" exists.

LString clFileSystem::FindFile ( const LString &  FileName,
const LString &  ParentFileName 
)

Remove full path from FileName and use full path from ParentFileName if FileName exists there. Otherwise return original FileName.

iMountPoint * clFileSystem::FindMountPoint ( const LString &  FileName) const [private]

Search for a mount point for this file.

iMountPoint * clFileSystem::FindMountPointByName ( const LString &  ThePath)

Get mount point by its name (dir/archive)

scriptmethod clDownloadThread* clFileSystem::GetDownloadThread ( ) const [inline]

Manual control of the download thread.

Lint64 clFileSystem::GetFileTime ( const LString &  FileName) const

Get file modification date/time.

LString clFileSystem::GetFullPath ( const LString &  PhysicalPath) const

Convert relative physical path to absolute physical path.

Lint64 clFileSystem::GetMaxTimeForDirectory ( const LString &  DirName) const

Determine latest modification date/time for the files in a given directory.

scriptmethod iMountPoint* clFileSystem::GetMountPoint ( size_t  Idx) const [inline]

Get mount point by index.

scriptmethod size_t clFileSystem::GetNumMountPoints ( ) const [inline]

Get total number of used mount points.

clMemRAWFile * clFileSystem::GetResourceStream ( const LString &  ResourceID,
const LString &  ResourceType 
) const [private]

Win32/Win64 OS-specific : access to resources embedded into the executable.

scriptmethod bool clFileSystem::GetUseVirtualFileNames ( ) const [inline]

Disable usage of virtual file names.

bool clFileSystem::IsFatalOnErrors ( ) const [private]

Do we throw exceptions in XLML parsing or not.

bool clFileSystem::IsFullPath ( const LString &  Path) const

Windows-specific check for the appearance of ":" symbol.

clBlob * clFileSystem::LoadFileAsBlob ( const LString &  FName) const

Load binary data to the newly allocated buffer (Blob)

bool clFileSystem::LoadFileData ( const LString &  FName,
void **  Data,
Luint64 DataSize 
) const

Load binary data to the newly allocated buffer.

It is an error, if the buffer is still zero

bool clFileSystem::LoadFileLinesArray ( const LString &  FName,
LArray< LString > &  Lines 
) const

Load all lines from text file to LArray.

bool clFileSystem::LoadFileLinesVec ( const LString &  FName,
std::vector< LString > &  Lines 
) const

Load all lines from text file to std::vector.

mlNode * clFileSystem::LoadXLML ( const LString &  FileName) const

Load an hierarchy of nodes representing input XLML stream (input XLML stream type (XLML, BinaryML, or XML) is detected automatically from file extension)

mlNode * clFileSystem::LoadXLML_ASE ( const LString &  FileName) const

Load an hierarchy of nodes representing input ASE-like XLML stream.

mlNode * clFileSystem::LoadXLML_Internal ( const LString &  FileName,
bool  NonStrictASEMode 
) const [private]

Load an hierarchy of nodes representing input ASE-like XLML stream.

mlNode * clFileSystem::LoadXLMLFromStream ( iIStream IStream) const

Create an hierarchy of nodes representing input XLML stream (IStream)

mlNode * clFileSystem::LoadXLMLFromStream_ASE ( iIStream IStream) const

Create an hierarchy of nodes representing ASE-like XLML stream.

mlNode * clFileSystem::LoadXLMLFromStream_Internal ( iIStream IStream,
bool  NonStrictASEMode 
) const [private]

Create an hierarchy of nodes representing XLML stream with different reading modes.

mlNode * clFileSystem::LoadXML ( const LString &  FileName) const

Load an hierarchy of nodes representing input XLML stream (input XLML stream type (XLML, BinaryML, or XML) is detected automatically from file extension)

mlNode * clFileSystem::LoadXMLFromStream ( iIStream IStream) const

Create an hierarchy of nodes representing input XLML stream (IStream)

void clFileSystem::Mount ( const LString &  PhysicalPath)

Add new mount point.

Parameters:
PhysicalName- the name of physical directory, uncompressed .RAR archive or "RESOURCE:<name>" string, telling the file system to use the resource embedded into the executable
void clFileSystem::OpenImageDialog ( )

open image dialog

void clFileSystem::OpenURL ( const LString &  URL)

open URL in a default web browser

void clFileSystem::RemoveDirWatch ( const LString &  DirName)

Remove dir change notification.

void clFileSystem::RemoveDirWatchC ( const LString &  Args)
void clFileSystem::RemoveFileWatch ( const LString &  FileName)

Remove file change notification.

void clFileSystem::RemoveFileWatchC ( const LString &  Args)
void clFileSystem::RemoveMountPoint ( iMountPoint MP)

Manually remove the mount point.

LString clFileSystem::ReplaceEnvVars ( const LString &  String) [static]

Replace all $ vars in a string. I.e. "C:\$PROJECT\FPC" where $PROJECT will be replaces with the value of PROJECT environment variable

bool clFileSystem::SaveBlobToFile ( const LString &  FName,
clBlob Blob 
) const

Save blob to file.

bool clFileSystem::SaveFileData ( const LString &  FName,
const void *  Data,
Luint64  DataSize 
) const

Save binary data to the file.

bool clFileSystem::SaveFileLinesArray ( const LString &  FName,
const LArray< LString > &  Lines 
) const

Save an array of strings to file.

bool clFileSystem::SaveFileLinesVec ( const LString &  FName,
const std::vector< LString > &  Lines 
) const

Save a vector of strings to file.

bool clFileSystem::SaveXLML ( mlNode Node,
const LString &  FileName 
) const

Save XLML representation of the mlNode tree.

bool clFileSystem::SaveXLMLToLog ( mlNode Node) const

Save XLML representation of the mlNode tree to engine log.

bool clFileSystem::SaveXLMLToStream ( mlNode Node,
iOStream OStream 
) const

Save XLML representation of the mlNode tree to the output stream.

Save XLML representation of the mlNode tree to output stream.

bool clFileSystem::SaveXML ( mlNode Node,
const LString &  FileName 
) const

Save XML representation of the mlNode tree.

bool clFileSystem::SaveXMLToLog ( mlNode Node) const

Save XML representation of the mlNode tree to engine log.

bool clFileSystem::SaveXMLToStream ( mlNode Node,
iOStream OStream 
) const

Save XML representation of the mlNode tree to the output stream.

Save XML representation of the mlNode tree to output stream.

void clFileSystem::SetRootDir ( const LString &  RootDir)

Set the root directory name for the virtual system.

This directory name is added to any virtual file name passed to the virtual file system. E.g., if RootDir == "Data", then the virtual file name "test.file" will be converted to "Data/test.file"

Parameters:
RootDir- the name of root directory
scriptmethod void clFileSystem::SetUseVirtualFileNames ( bool  Use) [inline]

Enable or disable usage of virtual file names.

void clFileSystem::SetWallpaper ( const LString &  ImageFileName)

set desktop wallpaper

void clFileSystem::SplitPath ( const LString &  Path,
LString *  Drive,
LString *  Dir,
LString *  FileName,
LString *  FileExt 
) [static]

Split path to components If one of the pointers (Drive,Dir,FileName,FileExt) is NULL, then it is not filled then

Parameters:
Path- path to be split
Drive- pointer to drive container
Dir- pointer to dir container
FileName- pointer to file name container
FileExt- pointer to file extension container
void clFileSystem::StartDirectoryWatch ( const LString &  DirName,
bool  Recursive,
iObject Handler 
)

Watch all files in the directory (using FS::Enumerate)

clHTTPServerThread * clFileSystem::StartWebServer ( const LString &  BindAddress,
int  BindPort,
int  MaxConn 
)

Start a new instance of web server and attach it to the specified address allowing MaxConn simultaneous connections.

void clFileSystem::StartWebServerC ( const LString &  Args) [private]
void clFileSystem::StopWebServersC ( const LString &  Args) [private]
void clFileSystem::Unmount ( const LString &  ThePath)

Remove the mount point.

This can be dangerous, because no information about opened file streams is preserved

Parameters:
ThePath- name/path of the mount point to remove

Cannot unmount root

LString clFileSystem::ValidatePath ( LString  PathName) [static]

Check if the specified physical file name is valid for OS (backslashes and other things)

LString clFileSystem::VirtualNameToPhysical ( const LString &  Path) const

Convert internal file name to system path.

LString clFileSystem::VirtualNameToPhysicalFull ( const LString &  Path) const

Convert internal file name to full system path.


Member Data Documentation

declares this class capable of throwing exceptions

HTTP download thread. I just don't know where to put this.

the list of active mount points

Can be more than one, no time to mess with pointers though.

use virtual file names with mount points (true by defaul)


The documentation for this class was generated from the following files: