DCHK Client Version 0.5.7 - Documentation DomainCheck

dchk::CDomainList Class Reference
[C++-API]

A class to hold a list of domains. More...

#include <dchk.h>


Detailed Description

This class implements a list of domains stored in DCHK_RECORD structures. It is used for bundled DCHK requests.

Error functions



void CopyError (IRISLWZ_HANDLE *handle)
 Copies an error from an IRISLWZ_HANDLE into this class.
const char * GetAdditionalErrorText () const
 Return additional information about last error.
int GetErrorCode () const
 Return last error code.
const char * GetErrorText () const
 Return text of last error code.
void PrintError () const
 Print last error to STDOUT.
void SetError (int code, const char *fmt=NULL,...)
 Set an error on this class.

Public Member Functions

int AddDomain (const char *domain, int n=0)
 Add a domain to the list.
 CDomainList ()
 constructor of the class
void Clear ()
 destructor of the class
int Count () const
 Returns number of elements in this list.
int Explode (const char *string, const char *delimiter)
 Add multiple domains to the list.
DCHK_RECORDGetFirst ()
 returns pointer to first element in this list
DCHK_RECORDGetNext ()
 returns pointer to next element in this list
void Reset ()
 Resets the pointer to the first element.
 ~CDomainList ()
 destructor of the class

Private Attributes

DCHK_DOMAINLIST list
DCHK_RECORDptr

Friends

class CDchk

Constructor & Destructor Documentation

dchk::CDomainList::CDomainList (  ) 

Initializes the list.

dchk::CDomainList::~CDomainList (  ) 

Frees all memory used by the class an the elements of the list.


Member Function Documentation

int dchk::CDomainList::AddDomain ( const char *  domain,
int  n = 0 
)

With this member function you can add a domain name to the list

Parameters:
[in] domain pointer to domain name, which must not be longer than 512 bytes
[in] n optional parameter containing the size of the domain string. Only the first
bytes of the domain string will be copied into the list. If domain is shorter than
, the complete string is copied.
Returns:
On success, the function returns 1, otherwise 0. An error could only occur, when the domain parameter points to NULL, when the process is out of memory or when the domain name is longer than 512 bytes.
void dchk::CDomainList::Clear (  ) 

Frees all memory used by the class an the elements of the list.

void dchk::CError::CopyError ( IRISLWZ_HANDLE handle  )  [inherited]

This function is used internally to copy an error from an IRISLWZ_HANDLE object into this class.

Parameters:
[in] handle Pointer to a IRISLWZ_HANDLE object
int dchk::CDomainList::Count (  )  const

This function returns the number of elements in the list.

Returns:
Number of elements
int dchk::CDomainList::Explode ( const char *  string,
const char *  delimiter 
)

With this function you can add multiple domains to the list, which are all in one string and separated by a specific delimiter.

Parameters:
[in] string Pointer to a text string containing the domain names
[in] delimiter Pointer to a string, which contains the delimiter if the domains. This could be a single char (like space or tab), but also a longer string.
Returns:
On success, the function returns the number of domains added to the list, otherwise 0.
const char * dchk::CError::GetAdditionalErrorText (  )  const [inherited]

Return additional information about last error.

Returns:
Pointer to the additional error text, or NULL if there is no text.
int dchk::CError::GetErrorCode (  )  const [inherited]

Return last error code

Returns:
last error code
Remarks:
Please keep in mind that a non zero value does not necessarily mean that the previous function was not successful. If a function returns a value, you should always check if it is valid or indicates an error. Most functions return 0 or NULL when an error occurred, and only if this is the case, you will get the correct error.
const char * dchk::CError::GetErrorText (  )  const [inherited]

Return text of last error code

Returns:
Pointer to the error text.
DCHK_RECORD * dchk::CDomainList::GetFirst (  ) 

This function returns a DCHK_RECORD pointer to the first element in the list.

Returns:
Returns a DCHK_RECORD pointer or NULL, if the list contains no entries.
DCHK_RECORD * dchk::CDomainList::GetNext (  ) 

This function returns a DCHK_RECORD pointer to the next element in the list.

Returns:
Returns a DCHK_RECORD pointer or NULL, if the end of the list was reached.
void dchk::CError::PrintError (  )  const [inherited]

This function prints the last error occurred in this class to STDOUT (Screen).

void dchk::CDomainList::Reset (  ) 

This function resets the internal pointer to the first element in the list. Next call to CDomainList::GetNext will return the first element.

void dchk::CError::SetError ( int  code,
const char *  fmt = NULL,
  ... 
) [inherited]

This function is used internally to store an error in this class

Parameters:
[in] code Error code
[in] fmt Format string for an additional error text. The syntax of this string is identical to sprintf/printf.
[in] ... Optional additional parameters for the format string

Friends And Related Function Documentation

friend class CDchk [friend]

Field Documentation


The documentation for this class was generated from the following files:
Generated on Wed Aug 4 21:23:46 2010 for DCHK Client Documentation by  doxygen 1.6.3