Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SLPluginFeature::Files Class Reference
[Plugins system]

This abstract class is the interface to get the list of user files that are stored in its database. More...

#include <SLPluginFeature.hpp>

Inheritance diagram for SLPluginFeature::Files:

Inheritance graph
[legend]
Collaboration diagram for SLPluginFeature::Files:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual const SLFileList getFileList ()=0
virtual const SLDirectoryList getDirectoryList ()=0
virtual SLFileList getFilesMatchingMime (const SLMime &mime)=0
virtual SLFileList getFilesMatchingExt (const SLFileExt &ext)=0
virtual void updateDirectory (SLDirectory &dir)=0
virtual void addDirectoryToDB (SLDirectory &dir, bool recursive=false)=0
virtual void delDirectoryFromDB (SLDirectory &dir, bool recursive=false)=0

Detailed Description

This abstract class is the interface to get the list of user files that are stored in its database.

See also:
SLPluginFeature
Author:
Alexandre Sauve
This interface can be used to add new directories into user database, to get files matching a specified mime type or extention, etc...

This class may try to access the SLPluginFeature::DBAccess active plugin.

This class may try to access the SLPluginFeature::MimeTypes active plugin.

code Example :

#include <iostream> #include "segusoland.hpp" #include "SLPluginRegister.hpp" #include "SLPluginFeature.hpp" #include "SLDirectoryList.hpp" try { // get the feature capable of handling files (quick) SLPluginFeature::Files *files = SL_FEATURE_GET(Files); // display the first ten directories in user database const SLDirectoryList dl = files->getDirectoryList(); for (unsigned int i = 0; i < dl.size() && i < 10; i++) { std::cout << " " << dl[i].getOSDependantPath()) << std::endl; } // release the feature (quick) SL_FEATURE_DISPOSE(files); } catch (SLPluginFeature::Files::Exception &e) { SL_WARNING("GOT AN EXCEPTION : " << e.getMessage().to_utf8()); } catch (SLPluginRegister::NotFoundException &e) { SL_WARNING("COULD NOT FIND THE Files FEATURE : " << e.getMessage().to_utf8()); }


Member Function Documentation

virtual void SLPluginFeature::Files::addDirectoryToDB SLDirectory dir,
bool  recursive = false
[pure virtual]
 

Add a new directory with all its files to the database.

Parameters:
dir is the path to the directory
recursive if set to "true" will turn recurse on and will add to database all sub-directories.
Warning:
each call to this method must be synchronised with directory change watching.

virtual void SLPluginFeature::Files::delDirectoryFromDB SLDirectory dir,
bool  recursive = false
[pure virtual]
 

Remove from the database a directory with all this files.

Parameters:
dir is the path to the directory
recursive if set to "true" will turn recurse on and will remove from database all sub-directories.
Warning:
each call to this method must be synchronised with directory change watching.

virtual const SLDirectoryList SLPluginFeature::Files::getDirectoryList  )  [pure virtual]
 

Returns the COMPLETE list of directories watched in the user database. This is usefull to feed the "Directory Alteration Monitor" for example.

Returns:
by reference a SLDirList object.

virtual const SLFileList SLPluginFeature::Files::getFileList  )  [pure virtual]
 

Gets the COMPLETE list (unsorted) of user files, use with care.

Returns:
by reference a FileList object.

virtual SLFileList SLPluginFeature::Files::getFilesMatchingExt const SLFileExt ext  )  [pure virtual]
 

Gets the complete list (unsorted) of files matching a given extention.

See also:
SLFile

SLFileExt

virtual SLFileList SLPluginFeature::Files::getFilesMatchingMime const SLMime mime  )  [pure virtual]
 

Gets the complete list (unsorted) of files matching a given Mime type.

Returns:
by reference a FileList object.
See also:
SLMime

virtual void SLPluginFeature::Files::updateDirectory SLDirectory dir  )  [pure virtual]
 

Update database when a directory change has been detected.


The documentation for this class was generated from the following file:
Generated on Mon Apr 19 01:03:38 2004 for segusoLand by doxygen 1.3.6-20040222