sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::ImapDS Class Reference

IMAP datasource. More...

#include <ImapDS.h>

Inheritance diagram for sptk::ImapDS:
sptk::MemoryDS sptk::DataSource

Public Member Functions

void host (const Host &host)
 
const Hosthost () const
 
void user (const String &usr)
 
const Stringuser () const
 
void password (const String &pwd)
 
const Stringpassword () const
 
void folder (const String &d)
 
const Stringfolder () const
 
void messageID (int msgid)
 
int messageID () const
 
void fetchBody (bool fb)
 
bool fetchBody () const
 
bool open () override
 
void callback (const ProgressCallback &cb)
 
 MemoryDS ()=default
 
 MemoryDS (const MemoryDS &other)=delete
 
 MemoryDS (MemoryDS &&other) noexcept
 
- Public Member Functions inherited from sptk::MemoryDS
 MemoryDS ()=default
 
 MemoryDS (const MemoryDS &other)=delete
 
 MemoryDS (MemoryDS &&other) noexcept
 
MemoryDSoperator= (const MemoryDS &other)=delete
 
MemoryDSoperator= (MemoryDS &&other) noexcept
 
virtual void clear ()
 
virtual FieldListcurrent ()
 
Fieldoperator[] (size_t fieldIndex) override
 
Fieldoperator[] (const String &fieldName) override
 
size_t fieldCount () const override
 
size_t recordCount () const override
 
bool readField (const char *fieldName, Variant &fieldValue) override
 
bool writeField (const char *fieldName, const Variant &fieldValue) override
 
bool open () override
 
bool close () override
 
bool first () override
 
bool next () override
 
bool prior () override
 
bool last () override
 
bool find (const String &fieldName, const Variant &position) override
 
bool eof () const override
 
bool empty () const
 
std::list< FieldList > & rows ()
 
const std::list< FieldList > & rows () const
 
void push_back (FieldList &&fieldList)
 
- Public Member Functions inherited from sptk::DataSource
 DataSource ()=default
 
virtual ~DataSource ()=default
 
virtual Fieldoperator[] (size_t fieldIndex)=0
 
virtual Fieldoperator[] (const String &fieldName)=0
 
virtual size_t fieldCount () const =0
 
virtual size_t recordCount () const =0
 
virtual bool readField (const char *fieldName, Variant &fieldValue)=0
 
virtual bool writeField (const char *fieldName, const Variant &fieldValue)=0
 
virtual bool open ()
 
virtual bool close ()
 
virtual bool first ()
 
virtual bool next ()
 
virtual bool prior ()
 
virtual bool last ()
 
virtual bool find (const String &, const Variant &)
 
virtual bool eof () const
 
bool load ()
 
bool save ()
 
void exportRowTo (const xdoc::SNode &node, bool compactXmlMode, bool nullLargeData=false)
 
virtual void exportTo (xdoc::Node &parentNode, const String &nodeName, bool compactXmlMode)
 

Additional Inherited Members

- Protected Member Functions inherited from sptk::DataSource
virtual bool loadData ()
 
virtual bool saveData ()
 

Detailed Description

IMAP datasource.

Allows to browse the list of messages and folders on IMAP server. It returns a dataset with message headers.

Member Function Documentation

◆ callback()

void sptk::ImapDS::callback ( const ProgressCallback cb)
inline

Optional callback for the open() method progression.

Parameters
cbCProgressCallback, a callback function

◆ fetchBody() [1/2]

bool sptk::ImapDS::fetchBody ( ) const
inline

Returns the current value of the fetch body flag

Returns
the fetch body flag

◆ fetchBody() [2/2]

void sptk::ImapDS::fetchBody ( bool  fb)
inline

Sets the fetch body flag. Should be called prior to open(). If the fetch body flag is not set, only the message headers will be retrieved and that is much faster.

◆ folder() [1/2]

const String & sptk::ImapDS::folder ( ) const
inline

IMAP folder name

◆ folder() [2/2]

void sptk::ImapDS::folder ( const String d)
inline

IMAP folder name

◆ host() [1/2]

const Host & sptk::ImapDS::host ( ) const
inline

Get IMAP host

◆ host() [2/2]

void sptk::ImapDS::host ( const Host host)
inline

Set IMAP host

◆ MemoryDS() [1/3]

sptk::MemoryDS::MemoryDS ( )
default

Default constructor

◆ MemoryDS() [2/3]

sptk::MemoryDS::MemoryDS ( const MemoryDS other)
delete

Default constructor

◆ MemoryDS() [3/3]

sptk::MemoryDS::MemoryDS ( MemoryDS &&  other)
inlinenoexcept

Default constructor

◆ messageID() [1/2]

int sptk::ImapDS::messageID ( ) const
inline

Returns the ID of the message when defined to retrieve one message only

◆ messageID() [2/2]

void sptk::ImapDS::messageID ( int  msgid)
inline

IMAP message ID (message number in the folder). If defined, the open() will retrieve only the message with the selected ID (if any)

◆ open()

bool sptk::ImapDS::open ( )
overridevirtual

Opens the IMAP server connection with user name and password defined with user() and password(). Scans the IMAP folder defined with folder(), than closes the IMAP server connection.

Reimplemented from sptk::MemoryDS.

◆ password() [1/2]

const String & sptk::ImapDS::password ( ) const
inline

IMAP user password

◆ password() [2/2]

void sptk::ImapDS::password ( const String pwd)
inline

IMAP user password

◆ user() [1/2]

const String & sptk::ImapDS::user ( ) const
inline

IMAP user name

◆ user() [2/2]

void sptk::ImapDS::user ( const String usr)
inline

IMAP user name


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

Fri Oct 14 2022 09:58:43: SPTK 5.4.1