Some more class documentation.

This commit is contained in:
Vincent Richard 2004-12-22 14:55:43 +00:00
parent 8d19078b26
commit 4f9e439eec
27 changed files with 392 additions and 229 deletions

View File

@ -34,6 +34,9 @@ namespace vmime
{ {
/** Base class for all types of attachment.
*/
class attachment class attachment
{ {
friend class messageBuilder; friend class messageBuilder;

View File

@ -98,6 +98,8 @@ namespace lineLengthLimits
#ifndef VMIME_BUILDING_DOC
// //
// V-Mime Initializer // V-Mime Initializer
// ==================== // ====================
@ -133,5 +135,7 @@ public:
initializer theInitializer; initializer theInitializer;
#endif // VMIME_BUILDING_DOC
} // vmime } // vmime

View File

@ -28,6 +28,8 @@ extern "C"
{ {
#include <iconv.h> #include <iconv.h>
#ifndef VMIME_BUILDING_DOC
// HACK: prototypes may differ depending on the compiler and/or system (the // HACK: prototypes may differ depending on the compiler and/or system (the
// second parameter may or may not be 'const'). This redeclaration is a hack // second parameter may or may not be 'const'). This redeclaration is a hack
// to have a common prototype "iconv_cast". // to have a common prototype "iconv_cast".
@ -35,6 +37,8 @@ extern "C"
size_t *inbytesleft, char* * outbuf, size_t *outbytesleft); size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
#define iconv_const ((iconv_const_hack) iconv) #define iconv_const ((iconv_const_hack) iconv)
#endif // VMIME_BUILDING_DOC
} }

View File

@ -29,6 +29,9 @@ namespace vmime
{ {
/** Default implementation for attachments.
*/
class defaultAttachment : public attachment class defaultAttachment : public attachment
{ {
protected: protected:

View File

@ -30,6 +30,9 @@ namespace vmime
{ {
/** Encode/decode data in different encodings.
*/
class encoder class encoder
{ {
public: public:

View File

@ -71,6 +71,8 @@ const unsigned char encoderQP::sm_hexDecodeTable[256] =
}; };
#ifndef VMIME_BUILDING_DOC
#define QP_ENCODE_HEX(x) \ #define QP_ENCODE_HEX(x) \
outBuffer[outBufferPos] = '='; \ outBuffer[outBufferPos] = '='; \
outBuffer[outBufferPos + 1] = sm_hexDigits[x >> 4]; \ outBuffer[outBufferPos + 1] = sm_hexDigits[x >> 4]; \
@ -78,6 +80,8 @@ const unsigned char encoderQP::sm_hexDecodeTable[256] =
outBufferPos += 3; \ outBufferPos += 3; \
curCol += 3; curCol += 3;
#endif // VMIME_BUILDING_DOC
const utility::stream::size_type encoderQP::encode(utility::inputStream& in, utility::outputStream& out) const utility::stream::size_type encoderQP::encode(utility::inputStream& in, utility::outputStream& out)
{ {

View File

@ -30,6 +30,9 @@ namespace vmime
{ {
/** Base class for VMime exceptions.
*/
class exception class exception
{ {
private: private:

View File

@ -28,6 +28,9 @@ namespace vmime
{ {
/** Attachment of type 'file'.
*/
class fileAttachment : public defaultAttachment class fileAttachment : public defaultAttachment
{ {
public: public:
@ -35,6 +38,8 @@ public:
fileAttachment(const string& filename, const mediaType& type, const text& desc = NULL_TEXT); fileAttachment(const string& filename, const mediaType& type, const text& desc = NULL_TEXT);
fileAttachment(const string& filename, const mediaType& type, const encoding& enc, const text& desc = NULL_TEXT); fileAttachment(const string& filename, const mediaType& type, const encoding& enc, const text& desc = NULL_TEXT);
/** Stores information about a file attachment.
*/
class fileInfo class fileInfo
{ {
public: public:
@ -42,27 +47,102 @@ public:
fileInfo(); fileInfo();
~fileInfo(); ~fileInfo();
/** Check whether the 'filename' property is present.
*
* @return true if the 'filename' property is set,
* false otherwise
*/
const bool hasFilename() const; const bool hasFilename() const;
/** Return the value of the 'filename' property.
*
* @return file name
*/
const string& getFilename() const; const string& getFilename() const;
/** Set the value of the 'filename' property.
*
* @param name file name
*/
void setFilename(const string& name); void setFilename(const string& name);
/** Check whether the 'creation-date' property is present.
*
* @return true if the 'creation-date' property is set,
* false otherwise
*/
const bool hasCreationDate() const; const bool hasCreationDate() const;
/** Return the value of the 'creation-date' property.
*
* @return file creation time
*/
const datetime& getCreationDate() const; const datetime& getCreationDate() const;
/** Set the value of the 'creation-date' property.
*
* @param date file creation time
*/
void setCreationDate(const datetime& date); void setCreationDate(const datetime& date);
/** Check whether the 'modification-date' property is present.
*
* @return true if the 'modification-date' property is set,
* false otherwise
*/
const bool hasModificationDate() const; const bool hasModificationDate() const;
/** Return the value of the 'modification-date' property.
*
* @return file modification time
*/
const datetime& getModificationDate() const; const datetime& getModificationDate() const;
/** Set the value of the 'modification-date' property.
*
* @param date file modification time
*/
void setModificationDate(const datetime& date); void setModificationDate(const datetime& date);
/** Check whether the 'read-date' property is set.
*
* @return true if the 'read-date' property is set,
* false otherwise
*/
const bool hasReadDate() const; const bool hasReadDate() const;
/** Return the value of the 'read-date' property.
*
* @return file access time
*/
const datetime& getReadDate() const; const datetime& getReadDate() const;
/** Set the value of the 'read-date' property.
*
* @param date file access time
*/
void setReadDate(const datetime& date); void setReadDate(const datetime& date);
/** Check whether the value of the 'size' property is set.
*
* @return true if the 'size' property is set,
* false otherwise
*/
const bool hasSize() const; const bool hasSize() const;
/** Return the value of the 'size' property.
*
* @return file size
*/
const unsigned int getSize() const; const unsigned int getSize() const;
/** Set the value of the 'size' property.
*
* @param size file size
*/
void setSize(const unsigned int& size); void setSize(const unsigned int& size);
protected: private:
string* m_filename; string* m_filename;
unsigned int* m_size; unsigned int* m_size;

View File

@ -79,6 +79,9 @@ private:
}; };
/** Generic implementation for headerField with a value of type 'string'.
*/
template <> template <>
class genericField <string> : public genericField <typeAdapter <string> > class genericField <string> : public genericField <typeAdapter <string> >
{ {

View File

@ -79,6 +79,9 @@ private:
}; };
/** Generic implementation for parameter of type 'string'.
*/
template <> template <>
class genericParameter <string> : public genericParameter <typeAdapter <string> > class genericParameter <string> : public genericParameter <typeAdapter <string> >
{ {

View File

@ -46,6 +46,7 @@ protected:
public: public:
#ifndef VMIME_BUILDING_DOC
template <class TYPE> template <class TYPE>
class registerer class registerer
{ {
@ -57,6 +58,7 @@ public:
return new TYPE(); return new TYPE();
} }
}; };
#endif // VMIME_BUILDING_DOC
template <class T> template <class T>

View File

@ -58,6 +58,8 @@ messageParser::~messageParser()
void messageParser::parse(const message& msg) void messageParser::parse(const message& msg)
{ {
// Header fields (if field is present, copy its value, else do nothing) // Header fields (if field is present, copy its value, else do nothing)
#ifndef VMIME_BUILDING_DOC
#define TRY_FIELD(var, type, name) \ #define TRY_FIELD(var, type, name) \
try { var = dynamic_cast<type&>(*msg.getHeader()->findField(name)).getValue(); } \ try { var = dynamic_cast<type&>(*msg.getHeader()->findField(name)).getValue(); } \
catch (exceptions::no_such_field) { } catch (exceptions::no_such_field) { }
@ -72,6 +74,8 @@ void messageParser::parse(const message& msg)
#undef TRY_FIELD #undef TRY_FIELD
#endif // VMIME_BUILDING_DOC
// Date // Date
try try
{ {

View File

@ -232,6 +232,8 @@ class structure& IMAPpart::getStructure()
#ifndef VMIME_BUILDING_DOC
// //
// IMAPMessage_literalHandler // IMAPMessage_literalHandler
// //
@ -268,6 +270,8 @@ private:
progressionListener* m_progress; progressionListener* m_progress;
}; };
#endif // VMIME_BUILDING_DOC
// //

View File

@ -17,6 +17,9 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#ifndef VMIME_BUILDING_DOC
#define REGISTER_SERVICE(p_class, p_name) \ #define REGISTER_SERVICE(p_class, p_name) \
vmime::messaging::service::initializer <vmime::messaging::p_class> p_name(#p_name) vmime::messaging::service::initializer <vmime::messaging::p_class> p_name(#p_name)
@ -44,3 +47,5 @@
REGISTER_SERVICE(maildirStore, maildir); REGISTER_SERVICE(maildirStore, maildir);
#endif #endif
#endif // VMIME_BUILDING_DOC

View File

@ -29,8 +29,10 @@ namespace vmime {
namespace messaging { namespace messaging {
/** An auhenticator that simply returns the credentials set in the /** Default implementation for authenticator. It simply returns
* session properties (named 'username' and 'password'). * the credentials set in the session properties (named 'username'
* and 'password'). This is the default implementation used if
* you do not write your own authenticator object.
*/ */
class defaultAuthenticator : public authenticator class defaultAuthenticator : public authenticator

View File

@ -34,9 +34,8 @@ class folder;
namespace events { namespace events {
// /** Event about the message count in a folder.
// messageCountEvent */
//
class messageCountEvent class messageCountEvent
{ {
@ -44,8 +43,8 @@ public:
enum Types enum Types
{ {
TYPE_ADDED, // new messages TYPE_ADDED, /**< New messages have been added. */
TYPE_REMOVED // expunged messages: renumbering TYPE_REMOVED /**< Messages have been expunged (renumbering). */
}; };
@ -65,6 +64,9 @@ private:
}; };
/** Listener for events about the message count in a folder.
*/
class messageCountListener class messageCountListener
{ {
protected: protected:
@ -78,9 +80,8 @@ public:
}; };
// /** Event occuring on a message.
// messageChangedEvent */
//
class messageChangedEvent class messageChangedEvent
{ {
@ -108,6 +109,9 @@ private:
}; };
/** Listener for events occuring on a message.
*/
class messageChangedListener class messageChangedListener
{ {
protected: protected:
@ -120,9 +124,8 @@ public:
}; };
// /** Event occuring on a folder.
// folderEvent */
//
class folderEvent class folderEvent
{ {
@ -130,9 +133,9 @@ public:
enum Types enum Types
{ {
TYPE_CREATED, // a folder was created TYPE_CREATED, /**< A folder was created. */
TYPE_DELETED, // a folder was deleted TYPE_DELETED, /**< A folder was deleted. */
TYPE_RENAMED // a folder was renamed TYPE_RENAMED /**< A folder was renamed. */
}; };
@ -152,6 +155,9 @@ private:
}; };
/** Listener for events occuring on a folder.
*/
class folderListener class folderListener
{ {
protected: protected:

View File

@ -35,6 +35,9 @@ namespace vmime {
namespace messaging { namespace messaging {
/** Base class for messaging services.
*/
class service class service
{ {
protected: protected:
@ -114,6 +117,7 @@ public:
*/ */
authenticator* getAuthenticator(); authenticator* getAuthenticator();
#ifndef VMIME_BUILDING_DOC
// Basic service registerer // Basic service registerer
template <class S> template <class S>
class initializer class initializer
@ -126,6 +130,7 @@ public:
template registerServiceByProtocol <S>(protocol); template registerServiceByProtocol <S>(protocol);
} }
}; };
#endif // VMIME_BUILDING_DOC
private: private:

View File

@ -30,6 +30,9 @@ namespace vmime {
namespace messaging { namespace messaging {
/** Stores information about a messaging service.
*/
class serviceInfos class serviceInfos
{ {
friend class serviceFactory; friend class serviceFactory;

View File

@ -28,6 +28,9 @@ namespace vmime {
namespace messaging { namespace messaging {
/** Basic implementation for an authenticator.
*/
class simpleAuthenticator : public authenticator class simpleAuthenticator : public authenticator
{ {
public: public:

View File

@ -28,6 +28,9 @@ namespace vmime {
namespace messaging { namespace messaging {
/** Interface for connecting to servers.
*/
class socket class socket
{ {
public: public:
@ -81,6 +84,9 @@ public:
}; };
/** A class to create 'socket' objects.
*/
class socketFactory class socketFactory
{ {
public: public:

View File

@ -54,6 +54,9 @@ public:
}; };
/** A class to create 'timeoutHandler' objects.
*/
class timeoutHandlerFactory class timeoutHandlerFactory
{ {
public: public:

View File

@ -46,6 +46,7 @@ protected:
public: public:
#ifndef VMIME_BUILDING_DOC
template <class TYPE> template <class TYPE>
class registerer class registerer
{ {
@ -57,6 +58,7 @@ public:
return new TYPE(); return new TYPE();
} }
}; };
#endif // VMIME_BUILDING_DOC
template <class T> template <class T>

View File

@ -40,14 +40,17 @@ namespace vmime
{ {
/** The link between your application and VMime. It offers an interface to /** Allow setting or getting the current platform handler.
* access platform-dependant objects: sockets, date/time, file system, etc.
*/ */
class platformDependant class platformDependant
{ {
public: public:
/** Handles all platform-dependant operations. It offers an interface to
* access platform-dependant objects: sockets, date/time, file system, etc.
*/
class handler class handler
{ {
public: public:

View File

@ -44,6 +44,7 @@ protected:
NameMap m_nameMap; NameMap m_nameMap;
#ifndef VMIME_BUILDING_DOC
template <class TYPE> template <class TYPE>
class registerer class registerer
{ {
@ -55,6 +56,7 @@ protected:
return new TYPE(); return new TYPE();
} }
}; };
#endif // VMIME_BUILDING_DOC
public: public:

View File

@ -30,6 +30,9 @@ namespace vmime
{ {
/** An adapter to allow any type being treated as a 'component'.
*/
template <class TYPE> template <class TYPE>
class typeAdapter : public component class typeAdapter : public component
{ {

View File

@ -198,7 +198,7 @@ public:
}; };
/** Constructs file objects. /** Constructs 'file' objects.
*/ */
class fileSystemFactory class fileSystemFactory

View File

@ -344,7 +344,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
INPUT = ./src/ ./src/messaging/ ./src/utility/ INPUT = ./src/ ./src/messaging/ ./src/utility/ ./src/platforms/posix/
# If the value of the INPUT tag contains directories, you can use the # If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@ -376,7 +376,7 @@ EXCLUDE_SYMLINKS = NO
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. # certain files from those directories.
EXCLUDE_PATTERNS = */config.hpp */IMAPTag* */IMAPParser* */IMAPUtils* */IMAPConnection* */md5* */smartPtr* */authHelper.* EXCLUDE_PATTERNS = */config.hpp */IMAPTag* */IMAPParser* */IMAPUtils* */IMAPConnection* */md5* */smartPtr* */authHelper* */maildirUtils*
# The EXAMPLE_PATH tag can be used to specify one or more files or # The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see # directories that contain example code fragments that are included (see
@ -842,7 +842,7 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are # or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. # omitted =1 is assumed.
PREDEFINED = PREDEFINED = VMIME_BUILDING_DOC
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded. # this tag can be used to specify a list of macro names that should be expanded.