FXFileDict

class FXFileDict

The File Association dictionary associates a file extension with a FXFileAssoc record which contains command name, mime type, icons, and other information about the file type.

Inheritance:


Public Fields

[more]static const FXchar defaultExecBinding[]
Registry key used to find fallback executable icons
[more]static const FXchar defaultDirBinding[]
Registry key used to find fallback directory icons
[more]static const FXchar defaultFileBinding[]
Registry key used to find fallback document icons

Public Methods

[more] FXFileDict(FXApp* a)
Construct a dictionary mapping file-extension to file associations, using the application registry settings as a source for the bindings
[more] FXFileDict(FXApp* a, FXSettings* db)
Construct a dictionary mapping file-extension to file associations, using the specified settings database as a source for the bindings
[more]FXApp* getApp() const
Get application
[more]void setIconPath(const FXString& path)
Set icon search path
[more]FXString getIconPath() const
Return current icon search path
[more]FXFileAssoc* replace(const FXchar* ext, const FXchar* str)
Replace file association.
[more]FXFileAssoc* remove(const FXchar* ext)
Remove file association
[more]FXFileAssoc* find(const FXchar* ext)
Find file association already in dictionary
[more]FXFileAssoc* associate(const FXchar* key)
Find file association from registry
[more]virtual FXFileAssoc* findFileBinding(const FXchar* pathname)
Determine binding for the given file.
[more]virtual FXFileAssoc* findDirBinding(const FXchar* pathname)
Find directory binding from registry.
[more]virtual FXFileAssoc* findExecBinding(const FXchar* pathname)
Determine binding for the given executable.
[more]virtual void save(FXStream& store) const
Save to stream
[more]virtual void load(FXStream& store)
Load from stream
[more]virtual ~FXFileDict()
Destructor


Inherited from FXDict:

Public Methods

oFXint size() const
ovoid size(FXint m)
oFXint no() const
ovoid* insert(const FXchar* ky, const void* ptr, FXbool mrk=FALSE)
oconst FXchar* key(FXuint pos) const
ovoid* data(FXuint pos) const
oFXbool mark(FXuint pos) const
oFXint first() const
oFXint last() const
oFXint next(FXint pos) const
oFXint prev(FXint pos) const
ovoid clear()

Protected Methods

ovirtual void* createData(const void*)
ovirtual void deleteData(void*)


Inherited from FXObject:

Public Methods

oconst FXchar* getClassName() const
oFXbool isMemberOf(const FXMetaClass* metaclass) const


Documentation

The File Association dictionary associates a file extension with a FXFileAssoc record which contains command name, mime type, icons, and other information about the file type. The Registry is used as source of the file bindings; an alternative Settings database may be specified however.
ostatic const FXchar defaultExecBinding[]
Registry key used to find fallback executable icons

ostatic const FXchar defaultDirBinding[]
Registry key used to find fallback directory icons

ostatic const FXchar defaultFileBinding[]
Registry key used to find fallback document icons

o FXFileDict(FXApp* a)
Construct a dictionary mapping file-extension to file associations, using the application registry settings as a source for the bindings

o FXFileDict(FXApp* a, FXSettings* db)
Construct a dictionary mapping file-extension to file associations, using the specified settings database as a source for the bindings

oFXApp* getApp() const
Get application

ovoid setIconPath(const FXString& path)
Set icon search path

oFXString getIconPath() const
Return current icon search path

oFXFileAssoc* replace(const FXchar* ext, const FXchar* str)
Replace file association. The new association is written into the settings database under the FILETYPES section; the format of the association is as follows:

<extension> = "<command> ; <type> ; <bigicon> [ : <bigopenicon> ] ; <smallicon> [ : <smalliconopen> ] ; <mimetype>"

Where <command> is the command used to launch the application (e.g. "xv %s &"), and <type> is the file type string (e.g. "GIF Image"), <bigicon> and <bigiconopen> are the large icons shown in "Icons" mode, <smallicon> and <smalliconopen> are the small icons shown in "Details" mode, and <mimetype> is the RFC2045 mime type of the file.

For example:

[FILETYPES] gif="xv %s &;GIF Image;big.xpm:bigopen.xpm;mini.xpm:miniopen.xpm;image/gif" /home/jeroen=";Home;home.xpm;minihome.xpm;application/x-folder"

oFXFileAssoc* remove(const FXchar* ext)
Remove file association

oFXFileAssoc* find(const FXchar* ext)
Find file association already in dictionary

oFXFileAssoc* associate(const FXchar* key)
Find file association from registry

ovirtual FXFileAssoc* findFileBinding(const FXchar* pathname)
Determine binding for the given file. The default implementation tries the whole filename first, then tries the extensions. For example, for a file "source.tar.gz":

"source.tar.gz", "tar.gz", "gz"

are tried in succession. If no association is found the key "defaultfilebinding" is tried as a fallback association. A NULL is returned if no association of any kind is found.

ovirtual FXFileAssoc* findDirBinding(const FXchar* pathname)
Find directory binding from registry. The default implementation tries the whole pathname first, then tries successively smaller parts of the path. For example, a pathname "/usr/people/jeroen":

"/usr/people/jeroen" "/people/jeroen" "/jeroen"

are tried in succession. If no bindings are found, the key "defaultdirbinding" is tried as a fallback association. A NULL is returned if no association of any kind is found.

ovirtual FXFileAssoc* findExecBinding(const FXchar* pathname)
Determine binding for the given executable. The default implementation returns the fallback binding associated with the key "defaultexecbinding". A NULL is returned if no association of any kind is found.

ovirtual void save(FXStream& store) const
Save to stream

ovirtual void load(FXStream& store)
Load from stream

ovirtual ~FXFileDict()
Destructor


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.