Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members  

PLMFileProvider Class Reference

File provider (virtual class). More...

#include <PLMFileProvider.hpp>

Inheritance diagram for PLMFileProvider:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual bool Open (const char *source)=0
virtual const char * Name () const=0
virtual u32 NbFiles () const=0
virtual void Update ()
virtual PLMResFileOpenFile (const char *name) const=0
virtual PLMResFileOpenFile (const iterator &it) const=0
iterator Begin () const
iterator End () const
siterator SBegin () const
siterator SEnd () const
virtual void Sort (int how)
virtual bool CopyFile (const char *name, const char *path) const=0
virtual void PrintInfo () const=0

Protected Methods

virtual const char * FileName (u32 i) const=0
virtual u32 FileSize (u32 i) const=0
virtual time_t FileDate (u32 i) const=0
virtual bool FileAccess (u32 i, u32 perm_flags) const=0
virtual bool IsFileHidden (u32 i) const=0
virtual bool IsFile (u32 i) const=0
virtual bool IsFileLink (u32 i) const=0
virtual bool IsFileDir (u32 i) const=0
u32 SortedIndex (u32 i) const
u32 IterIndex (const iterator &it) const
virtual int CompareFunc (const PLMSortableItem *f1, const PLMSortableItem *f2) const=0
virtual PLMSortableItemGetItem (u32 i) const=0

Detailed Description

File provider (virtual class).


Member Function Documentation

virtual bool PLMFileProvider::Open const char *    source [pure virtual]
 

Open a new file source and close the current one.

Returns:
true on success.

Implemented in PLMArchive, PLMArchPLM, PLMArchPAK, and PLMDir.

virtual const char* PLMFileProvider::Name   [pure virtual]
 

Get the name of the provider.

Implemented in PLMArchive, and PLMDir.

virtual u32 PLMFileProvider::NbFiles   [pure virtual]
 

Get the total number of entries (files and directories).

Implemented in PLMArchive, and PLMDir.

virtual void PLMFileProvider::Update   [inline, virtual]
 

Force the source to update its content list.

Items are automatically sorted if Sort() has already been called.

Reimplemented in PLMDir.

virtual PLMResFile* PLMFileProvider::OpenFile const char *    name const [pure virtual]
 

Try to open the file (in read-only mode) named name (may contain a relative path).

Returns:
a valid file pointer (that must be deleted after use) on success, or NULL on error.

Implemented in PLMArchive, and PLMDir.

virtual PLMResFile* PLMFileProvider::OpenFile const iterator   it const [pure virtual]
 

Try to open the file (in read-only mode) pointed by the iterator it.

Returns:
a valid file pointer (that must be deleted after use) on success, or NULL on error.

iterator PLMFileProvider::Begin   const [inline]
 

Get an interator pointing on the first element of the current list.

iterator PLMFileProvider::End   const [inline]
 

Get an interator pointing just after the last element of the current list.

Usually to be compared with another iterator to find the end. Call iterator.Last() to get an iterator on the last element.

siterator PLMFileProvider::SBegin   const [inline]
 

Get a 'sorted' iterator pointing on the first item of the sorted list.

The sorted iterator will run through the list in the order set by the last call to Sort().

siterator PLMFileProvider::SEnd   const [inline]
 

Get a 'sorted' iterator pointing just after the last item of the sorted list.

Usually to be compared with another iterator to find the end. Call siterator.Last() to get an iterator on the last element.

virtual void PLMFileProvider::Sort int    how [virtual]
 

Change the order of the list.

Use PLM::SortFlags constants to select an order. Only one of SORT_NAME/SIZE/DATE/EXT can be selected and OR-ed with the other flags REVERSE, CASE and/or DIRS. Later calls to Open() and Update() will automatically use the same settings. Note that only SortedIterators will parse the list in the right order, standard iterators always use the native order (SORT_NONE). After a call to Sort(), any existing s(orted)iterator are not valid anymore, you should get a new one.

virtual bool PLMFileProvider::CopyFile const char *    name,
const char *    path
const [pure virtual]
 

Copy the file named name from the source, into a standard file.

Parameters:
name  the name of the file in the source
path  the directory to create the copied file. It can contain a file name too, in this case, the file uses that name.
Returns:
true on success.

Implemented in PLMArchive, and PLMDir.

virtual void PLMFileProvider::PrintInfo   [pure virtual]
 

Print some informations on current log.

Implemented in PLMArchive, and PLMDir.

virtual const char* PLMFileProvider::FileName u32    i const [protected, pure virtual]
 

Get the name (read-only) of the file at index i (from an iterator).

Implemented in PLMArchive, and PLMDir.

virtual u32 PLMFileProvider::FileSize u32    i const [protected, pure virtual]
 

Get the total size in bytes of the file at index i (from an iterator).

Implemented in PLMArchive, and PLMDir.

virtual time_t PLMFileProvider::FileDate u32    i const [protected, pure virtual]
 

Get the date of the file at index i (from an iterator).

Implemented in PLMArchive, and PLMDir.

virtual bool PLMFileProvider::FileAccess u32    i,
u32    perm_flags
const [protected, pure virtual]
 

Get the access mode of the file at index i (from an iterator).

Implemented in PLMArchive, and PLMDir.

virtual bool PLMFileProvider::IsFileHidden u32    i const [protected, pure virtual]
 

Check if the file at index i (from an iterator) is hidden.

Implemented in PLMArchive, and PLMDir.

virtual bool PLMFileProvider::IsFile u32    i const [protected, pure virtual]
 

Check if the element at index i (from an iterator) is a standard file (not a link or a folder).

Implemented in PLMArchive, and PLMDir.

virtual bool PLMFileProvider::IsFileLink u32    i const [protected, pure virtual]
 

Check if the element at index i (from an iterator) is a link (false under win32).

Implemented in PLMArchive, and PLMDir.

virtual bool PLMFileProvider::IsFileDir u32    i const [protected, pure virtual]
 

Check if the element at index i (from an iterator) is a directory.

Implemented in PLMArchive, and PLMDir.

u32 PLMFileProvider::SortedIndex u32    i const [inline, protected]
 

Get the "real" internal index of the i-th sorted element (from an iterator).

u32 PLMFileProvider::IterIndex const iterator   it const [inline, protected]
 

Get the internal index of the iterator.

virtual int PLMFileProvider::CompareFunc const PLMSortableItem   f1,
const PLMSortableItem   f2
const [protected, pure virtual]
 

Determine order between two items.

Returns:
  • if f1 = f2, return 0
  • if f1 < f2, a negative value
  • if f1 > f2, a positive value

Implemented in PLMArchive, and PLMDir.

virtual PLMSortableItem* PLMFileProvider::GetItem u32    i const [protected, pure virtual]
 

Get the real internalindex of the i-th sorted element.

Implemented in PLMArchive, and PLMDir.


The documentation for this class was generated from the following file:
  • PLMFileProvider.hpp

Generated by Doxygen 1.2.18 on Tue Oct 26 12:07:44 2004.