Generic GALILEI Application. More...
#include <ggalileiapp.h>
Public Member Functions | |
GGALILEIApp (const R::RString &name, int argc, char *argv[], bool dlg=false, const R::RString &localconfig=R::RString::Null, const R::RString &globalconfig=R::RString::Null) | |
GSession * | GetSession (const R::RString &name, bool &created, GSlot *slot=0, const R::RString &configdir=R::RString::Null) |
void | DeleteSession (GSession *session) |
R::RString | GetIndexDir (void) const |
void | SetIndexDir (const R::RString &name) |
R::RCursor< R::RString > | GetPlugInsPaths (void) const |
void | SetPlugInsPaths (const R::iRContainer< R::RString > &paths) |
R::RCursor< GPlugInManager > | GetManagers (void) |
GPlugInManager * | GetManager (const R::RString &mng) const |
R::RCursor< GPlugInFactory > | GetFactories (const R::RString &mng, const R::RString &list=R::RString::Null) const |
template<class plugin > | |
R::RCastCursor< GPlugIn, plugin > | GetPlugIns (const R::RString &mng, const R::RString &list=R::RString::Null) const |
GPlugInFactory * | GetFactory (const R::RString &mng, const R::RString &name, const R::RString &list, int need=1) const |
GPlugInFactory * | GetFactory (const R::RString &mng, const R::RString &name, int need=1) const |
GPlugIn * | GetPlugIn (const R::RString &mng, const R::RString &name, const R::RString &list, int need=1) const |
GPlugIn * | GetPlugIn (const R::RString &mng, const R::RString &name, int need=1) const |
template<class plugin > | |
plugin * | GetPlugIn (const R::RString &mng, const R::RString &name, const R::RString &list, int need=1) const |
template<class plugin > | |
plugin * | GetPlugIn (const R::RString &mng, const R::RString &name, int need=1) const |
GPlugInFactory * | GetCurrentFactory (const R::RString &mng, const R::RString &list, int need=1) const |
GPlugInFactory * | GetCurrentFactory (const R::RString &mng, int need=1) const |
template<class plugin > | |
plugin * | GetCurrentPlugIn (const R::RString &mng, const R::RString &list, int need=1) const |
template<class plugin > | |
plugin * | GetCurrentPlugIn (const R::RString &mng, int need=1) const |
void | SetCurrentPlugIn (const R::RString &mng, const R::RString &name, const R::RString &list, int need=1) |
void | SetCurrentPlugIn (const R::RString &mng, const R::RString &name, int need=1) |
void | RunPrg (GSlot *rec, const R::RString &filename) |
GFilter * | FindMIMEType (GDoc *doc) const |
GFilter * | FindScheme (GDoc *doc) const |
void | AddScheme (const char *mime, GFilter *f) |
void | AddMIME (const char *mime, GFilter *f) |
void | DelMIMES (GFilter *f) |
virtual | ~GGALILEIApp (void) |
Public Member Functions inherited from RContainer< GPlugInManager, true, false > | |
RContainer (size_t m, size_t i=0) | |
RContainer (const RContainer< GPlugInManager, true, false > &src) | |
RContainer (const RContainer< GPlugInManager, false, false > &src) | |
int | Compare (const RContainer< GPlugInManager, true, false > &) const |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (RContainer< GPlugInManager, a, o > &src) |
RContainer & | operator= (const RContainer< GPlugInManager, true, false > &src) |
RContainer & | operator= (const RContainer< GPlugInManager, false, false > &src) |
void | Copy (const RContainer< GPlugInManager, a, false > &src) |
RContainer & | operator+= (const RContainer< GPlugInManager, a, o > &src) |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const GPlugInManager * | operator[] (size_t idx) const |
GPlugInManager * | operator[] (size_t idx) |
const GPlugInManager * | GetPtrAt (size_t idx) const |
GPlugInManager * | GetPtrAt (size_t idx) |
GPlugInManager * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
GPlugInManager * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
GPlugInManager * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
GPlugInManager * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
GPlugInManager * | GetInsertPtrAt (const TUse &tag, size_t pos) |
RContainer< GPlugInManager, false, false > * | GetPtrs (const TUse &tag, size_t min=0, size_t max=0) const |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const GPlugInManager **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (GPlugInManager **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (GPlugInManager *ins, size_t pos, bool del) |
void | InsertPtrAt (GPlugInManager *ins, size_t pos) |
void | InsertPtr (GPlugInManager *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< GPlugInManager > &src1, const iRContainer< GPlugInManager > &src2) |
void | Union (const iRContainer< GPlugInManager > &src1, const iRContainer< GPlugInManager > &src2) |
virtual | ~RContainer (void) |
Public Member Functions inherited from iRContainer< C > | |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (iRContainer< C > &src) |
iRContainer & | operator= (const iRContainer< C > &src) |
void | Copy (const iRContainer< C > &src) |
iRContainer & | operator+= (const iRContainer< C > &src) |
size_t | GetIndex (bool order, const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const C * | operator[] (size_t idx) const |
C * | operator[] (size_t idx) |
const C * | GetPtrAt (size_t idx) const |
C * | GetPtrAt (size_t idx) |
C * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
C * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
C * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
C * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
C * | GetInsertPtrAt (const TUse &tag, size_t pos) |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const C **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (C **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (C *ins, size_t pos, bool del) |
void | InsertPtrAt (C *ins, size_t pos) |
void | InsertPtr (C *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< C > &src1, const iRContainer< C > &src2) |
void | Union (const iRContainer< C > &src1, const iRContainer< C > &src2) |
virtual | ~iRContainer (void) |
Protected Member Functions | |
virtual void | CreateConfig (void) |
virtual void | Init (void) |
void | FindPlugins (const R::RString dir, R::RContainer< R::RString, true, false > &plugins, R::RContainer< R::RString, true, false > &dlgs) |
void | Load (const R::RContainer< R::RString, true, false > &dirs, bool dlg=true) |
virtual GStorage * | CreateStorage (GSession *session) |
Protected Member Functions inherited from iRContainer< C > | |
void | Create (const iRContainer< C > &src) |
iRContainer & | NormalCopy (const iRContainer< C > &src) |
void | DeepCopy (const iRContainer< C > &src) |
iRContainer & | Add (const iRContainer< C > &src) |
Protected Attributes | |
R::RContainer< GSession, true, true > | Sessions |
R::RRWLock | lSessions |
GPlugInManager * | Storages |
GPlugInManager * | Langs |
bool | LoadDialogs |
R::RContainer< R::RString, true, false > | PlugInsPaths |
R::RString | IndexDir |
R::RContainer< cFilter, true, true > | MIMES |
R::RContainer< cExt, true, true > | Exts |
R::RContainer< cFilter, true, true > | Schemes |
R::RTextFile | Log |
Protected Attributes inherited from iRContainer< C > | |
C ** | Tab |
size_t | NbPtr |
size_t | MaxPtr |
size_t | LastPtr |
size_t | IncPtr |
Additional Inherited Members | |
Static Public Member Functions inherited from RContainer< GPlugInManager, true, false > | |
static int | SortOrder (const void *a, const void *b) |
Static Public Member Functions inherited from iRContainer< C > | |
static int | SortOrder (const void *a, const void *b) |
Detailed Description
Generic GALILEI Application.
The GGALILEIApp class represents a generic application running a session.
Each application inheriting from GGALILEIApp manages three configuration files:
- Its own configuration which defines at least two parameters. The "GALILEI Config" parameter gives the name of the configuration file for the GALILEI library ("GALILEI" by default). The "Session" parameter defines the current session name.
- A configuration file corresponding to the GALILEI library storing some global parameters (such as the directories of the plug-ins). Several applications may share this configuration file.
- The configuration file corresponding to the current session (storing the parameters for the plug-ins, the log file, etc.). All the applications having the same current session share this configuration file.
Constructor & Destructor Documentation
GGALILEIApp | ( | const R::RString & | name, |
int | argc, | ||
char * | argv[], | ||
bool | dlg = false , |
||
const R::RString & | localconfig = R::RString::Null , |
||
const R::RString & | globalconfig = R::RString::Null |
||
) |
Construct the application.
- Parameters
-
name Name of the application. argc Number of arguments. argv Arguments. dlg Dialog boxes must be loaded too? By default, no. localconfig Local configuration. globalconfig Local configuration.
|
virtual |
Destruct the application.
Member Function Documentation
|
protectedvirtual |
Create the configuration structure. New parameters can be added by defining a new method.
Reimplemented from RApplication.
|
protectedvirtual |
Initialization of the application.
GSession* GetSession | ( | const R::RString & | name, |
bool & | created, | ||
GSlot * | slot = 0 , |
||
const R::RString & | configdir = R::RString::Null |
||
) |
Get the session with a given name.
- Parameters
-
name Name of the session. created Determine if the session must be created if not existing. It is modified by the method if the session was created. slot Slot to show progress. configdir Directory where to search for the configuration file of the session.
void DeleteSession | ( | GSession * | session | ) |
Delete a session.
- Parameters
-
session Session.
R::RString GetIndexDir | ( | void | ) | const |
- Returns
- the name of the index directory.
void SetIndexDir | ( | const R::RString & | name | ) |
Set the name of the index directory.
- Parameters
-
name Name.
R::RCursor<R::RString> GetPlugInsPaths | ( | void | ) | const |
Get the list of plug-ins paths.
void SetPlugInsPaths | ( | const R::iRContainer< R::RString > & | paths | ) |
Set the list of plug-ins paths. @âram paths Paths to set.
|
protected |
Starting from a directory, this function looks for all shared libraries in the sub-directories and add them in the containers.
- Parameters
-
dir Root directory to scan. plugins Strings for each main plug-ins. dlgs Strings for each dialog plug-ins.
|
protected |
Load all plug-ins and their dialog boxes.
- Parameters
-
dirs Directories to search in. dlg Should the dialog boxes be loaded?
Create a valid storage. The method is call when a session is opened for which a current storage doesn't exist. By default, this method does nothing.
- Parameters
-
session Session for which the stoarge must be created.
- Returns
- a valid pointer to a GStorage.
R::RCursor<GPlugInManager> GetManagers | ( | void | ) |
Get a cursor over all the managers.
- Returns
- GPlugInManager A cursor on the managers
GPlugInManager* GetManager | ( | const R::RString & | mng | ) | const |
Get the manager associated to the "name".
- Parameters
-
mng Name of the manager to be found.
R::RCursor<GPlugInFactory> GetFactories | ( | const R::RString & | mng, |
const R::RString & | list = R::RString::Null |
||
) | const |
Get the factories of a given manager.
- Parameters
-
mng Name of the manager to be found. list List.
R::RCastCursor<GPlugIn,plugin> GetPlugIns | ( | const R::RString & | mng, |
const R::RString & | list = R::RString::Null |
||
) | const |
Get the plug-ins of a given manager.
- Template Parameters
-
plugin Class of the plug-in.
- Parameters
-
mng Name of the manager to be found. list List.
GPlugInFactory* GetFactory | ( | const R::RString & | mng, |
const R::RString & | name, | ||
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get a factory of a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugInFactory* GetFactory | ( | const R::RString & | mng, |
const R::RString & | name, | ||
int | need = 1 |
||
) | const |
Get a factory of a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugIn* GetPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get a plug-in of a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugIn* GetPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
int | need = 1 |
||
) | const |
Get a plug-in of a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
plugin* GetPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get a plug-in of a given manager.
- Template Parameters
-
plugin Class of the plug-in.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
plugin* GetPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
int | need = 1 |
||
) | const |
Get a plug-in of a given manager.
- Template Parameters
-
plugin Class of the plug-in.
- Parameters
-
mng Name of the manager to be found. name Name of the plug-in. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugInFactory* GetCurrentFactory | ( | const R::RString & | mng, |
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get the current factory of a given manager.
- Parameters
-
mng Name of the manager to be found. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
GPlugInFactory* GetCurrentFactory | ( | const R::RString & | mng, |
int | need = 1 |
||
) | const |
Get the current factory of a given manager.
- Parameters
-
mng Name of the manager to be found. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
plugin* GetCurrentPlugIn | ( | const R::RString & | mng, |
const R::RString & | list, | ||
int | need = 1 |
||
) | const |
Get the current plug-in of a given manager.
- Template Parameters
-
plugin Class of the plug-in.
- Parameters
-
mng Name of the manager to be found. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
plugin* GetCurrentPlugIn | ( | const R::RString & | mng, |
int | need = 1 |
||
) | const |
Get the current plug-in of a given manager.
- Template Parameters
-
plugin Class of the plug-in.
- Parameters
-
mng Name of the manager to be found. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
void SetCurrentPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
const R::RString & | list, | ||
int | need = 1 |
||
) |
Set the current plug-in for a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the method. list List. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
void SetCurrentPlugIn | ( | const R::RString & | mng, |
const R::RString & | name, | ||
int | need = 1 |
||
) |
Set the current plug-in for a given manager.
- Parameters
-
mng Name of the manager to be found. name Name of the method. need If the parameter is non-null and the plug-in doesn't exist, generate an exception.
void RunPrg | ( | GSlot * | rec, |
const R::RString & | filename | ||
) |
Run a "program".
- Parameters
-
rec Slot that receive information. filename Name of the file.
Find the filter corresponding to a document based on the MIME type.
An exception is generated if no filter was found (no MIME type, no corresponding filter, ...).
- Parameters
-
doc Document to analyse.
- Returns
- the filter needed to analyse the document.
Find the filter corresponding to a given scheme. This allows GALILEI to manage exotic schemes that CURL cannot handle.
- Parameters
-
doc Document with a given scheme.
- Returns
- the filter or a null pointer if no filter is found (hoping that CURL can handle the protocol).
void AddScheme | ( | const char * | mime, |
GFilter * | f | ||
) |
Add a pair (Scheme,filter).
- Parameters
-
scheùe Name of the scheme. f Pointer to the filter.
void AddMIME | ( | const char * | mime, |
GFilter * | f | ||
) |
Add a pair (MIME type,filter).
- Parameters
-
mime Name of the MIME type. f Pointer to the filter.
void DelMIMES | ( | GFilter * | f | ) |
Delete all the MIME type associated with a filter.
- Parameters
-
f Pointer to the filter.
Member Data Documentation
|
protected |
The Sessions.
|
protected |
Reader/writer lock on Session.
|
protected |
The storages.
|
protected |
The languages.
|
protected |
Load the dialog boxes
|
protected |
Path where to search for plug-ins
|
protected |
Directory where to binary files of the index are stored.
|
protected |
List of all pairs (MIME type,filter) available.
|
protected |
List of all pairs (extension, MIME type) available.
|
protected |
List of all pairs (Schemes,filter) available.
|
protected |
Log file for the application.