VMime
maildirFormat Class Referenceabstract
Inheritance diagram for maildirFormat:
Collaboration diagram for maildirFormat:

Classes

class  context
 

Public Types

enum  DirectoryType {
  ROOT_DIRECTORY, NEW_DIRECTORY, CUR_DIRECTORY, TMP_DIRECTORY,
  CONTAINER_DIRECTORY
}
 

Public Member Functions

virtual const string getName () const =0
 
virtual void createFolder (const folder::path &path)=0
 
virtual void destroyFolder (const folder::path &path)=0
 
virtual void renameFolder (const folder::path &oldPath, const folder::path &newPath)=0
 
virtual bool folderExists (const folder::path &path) const =0
 
virtual bool folderHasSubfolders (const folder::path &path) const =0
 
virtual const utility::file::path folderPathToFileSystemPath (const folder::path &path, const DirectoryType type) const =0
 
virtual const std::vector
< folder::path
listFolders (const folder::path &root, const bool recursive) const =0
 

Static Public Member Functions

static shared_ptr< maildirFormatdetect (shared_ptr< maildirStore > store)
 

Protected Member Functions

 maildirFormat (shared_ptr< context > ctx)
 
shared_ptr< contextgetContext ()
 
shared_ptr< const contextgetContext () const
 
virtual bool supports () const =0
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Static Protected Attributes

static const
utility::file::path::component 
TMP_DIR
 
static const
utility::file::path::component 
CUR_DIR
 
static const
utility::file::path::component 
NEW_DIR
 

Detailed Description

Interface for an object capable of reading a specific Maildir format.

Member Enumeration Documentation

Physical directory types.

Enumerator
ROOT_DIRECTORY 

Root directory.

NEW_DIRECTORY 

Directory containing unread messages.

CUR_DIRECTORY 

Directory containing messages that have been seen.

TMP_DIRECTORY 

Temporary directory used for reliable delivery.

CONTAINER_DIRECTORY 

Container for subfolders.

Constructor & Destructor Documentation

maildirFormat ( shared_ptr< context ctx)
protected

Member Function Documentation

virtual void createFolder ( const folder::path path)
pure virtual

Create the specified folder.

Parameters
pathvirtual path of the folder
Exceptions
exceptions::filesystem_exception,invalid_folder_name

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual void destroyFolder ( const folder::path path)
pure virtual

Destroy the specified folder.

Parameters
pathvirtual path of the folder
Exceptions
exceptions::filesystem_exception

Implemented in courierMaildirFormat, and kmailMaildirFormat.

shared_ptr< maildirFormat > detect ( shared_ptr< maildirStore store)
static

Try to detect the format of the specified Maildir store.

If the format cannot be detected, a compatible implementation will be returned.

Parameters
storeof which to detect format
Returns
a Maildir format implementation for the specified store

Referenced by maildirStore::connect().

virtual bool folderExists ( const folder::path path) const
pure virtual

Test whether the specified folder exists.

Parameters
pathvirtual path of the folder
Returns
true if the folder exists, false otherwise

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual bool folderHasSubfolders ( const folder::path path) const
pure virtual

Test whether the specified folder has subfolders.

Parameters
pathvirtual path of the folder
Returns
true if the folder has at least one subfolder, false otherwise

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual const utility::file::path folderPathToFileSystemPath ( const folder::path path,
const DirectoryType  type 
) const
pure virtual

Returns the directory which represents the specified folder on the file system.

Parameters
pathvirtual path of the folder
typetype of directory to return
Returns
corresponding directory on the file system

Implemented in courierMaildirFormat, and kmailMaildirFormat.

shared_ptr< maildirFormat::context > getContext ( )
protected

Returns the current context.

Returns
current context

Referenced by courierMaildirFormat::listDirectories(), and courierMaildirFormat::supports().

shared_ptr< const maildirFormat::context > getContext ( ) const
protected

Returns the current context (const version).

Returns
current context
virtual const string getName ( ) const
pure virtual

Return the name of this Maildir format.

Returns
format name

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual const std::vector<folder::path> listFolders ( const folder::path root,
const bool  recursive 
) const
pure virtual

List subfolders in the specified folder.

Parameters
rootroot folder in which to start the search
recursiveif set to true, all the descendant are returned; if set to false, only direct children are returned.
Returns
list of subfolders

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual void renameFolder ( const folder::path oldPath,
const folder::path newPath 
)
pure virtual

Rename the specified folder.

Parameters
oldPathold virtual path of the folder
newPathnew virtual path of the folder
Exceptions
exceptions::filesystem_exception

Implemented in courierMaildirFormat, and kmailMaildirFormat.

virtual bool supports ( ) const
protectedpure virtual

Quick checks whether this implementation can read the Maildir format in the specified directory.

Returns
true if the implementation supports the specified Maildir, or false otherwise

Implemented in courierMaildirFormat, and kmailMaildirFormat.

Member Data Documentation

const utility::file::path::component CUR_DIR
staticprotected

No longer new messages.

const utility::file::path::component NEW_DIR
staticprotected

Unread messages.

const utility::file::path::component TMP_DIR
staticprotected

Ensure reliable delivery (not to be listed).


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