Public Member Functions | Protected Member Functions | Protected Attributes

base_soap::SOAPInputCheck Class Reference

soap input check More...

#include <libppbase/base_soap/SOAPInputCheck.h>

List of all members.

Public Member Functions

bool addToResponse (SOAPResponse *response)
 Adds all errors the the soap response.
bool checkEmail (const base::String &name, const base::String &value, size_t minlen, size_t maxlen)
 Checks an e-mail address.
bool checkFile (const base::String &name, base::MemFile *file, size_t minsize, size_t maxsize)
 Checks a file.
bool checkPhone (const base::String &name, const base::String &value, size_t minlen, size_t maxlen)
 Checks a telephone number.
bool checkNumber (const base::String &name, const base::String &value, size_t minlen, size_t maxlen, size_t precision, bool sign)
 Checks a number.
bool checkString (const base::String &name, const base::String &value, size_t minlen, size_t maxlen, const base::String &allowed="", bool select=false)
 Checks a string.

Protected Member Functions

void compileAllowed (const base::String &allowed, bool *alpha, bool *digit, bool *unicode, base::String &other)
 Compiles an allowed character string.

Protected Attributes

base::DNS _dns
 dns lookup object for e-mail addresses

Detailed Description

soap input check

Author:
Christoph Schwarz
Version:
Id:
SOAPInputCheck.h 21 2010-09-05 04:18:17Z cschwarz1

Member Function Documentation

bool base_soap::SOAPInputCheck::addToResponse ( SOAPResponse response  ) 

Adds all errors the the soap response.

Parameters:
response the soap response to add the errors to
Returns:
true if errors have been added, false if not
bool base_soap::SOAPInputCheck::checkEmail ( const base::String name,
const base::String value,
size_t  minlen,
size_t  maxlen 
)

Checks an e-mail address.

Parameters:
name the field name
value the e-mail address to check
minlen minimum length of the e-mail address
maxlen maximum length of the e-mail address
Returns:
true if the check was successful, false if not
bool base_soap::SOAPInputCheck::checkFile ( const base::String name,
base::MemFile file,
size_t  minsize,
size_t  maxsize 
)

Checks a file.

Parameters:
name the field name
file the file, may be null to indicate that the file is missing
minsize minimum file size in bytes
maxsize maximum file size in bytes
Returns:
true if the check was successful, false if not
bool base_soap::SOAPInputCheck::checkNumber ( const base::String name,
const base::String value,
size_t  minlen,
size_t  maxlen,
size_t  precision,
bool  sign 
)

Checks a number.

Parameters:
name the field name
value the number to check
minlen minimum length of the number
maxlen maximum length of the number
precision maximum number of decimal digits
sign true to allow signed numbers, false to only allow unsigned ones
Returns:
true if the check was successful, false if not
bool base_soap::SOAPInputCheck::checkPhone ( const base::String name,
const base::String value,
size_t  minlen,
size_t  maxlen 
)

Checks a telephone number.

Parameters:
name the field name
value the phone number to check
minlen minimum length of the phone number
maxlen maximum length of the phone number
Returns:
true if the check was successful, false if not
bool base_soap::SOAPInputCheck::checkString ( const base::String name,
const base::String value,
size_t  minlen,
size_t  maxlen,
const base::String allowed = "",
bool  select = false 
)

Checks a string.

Parameters:
name the field name
value the string to check
minlen minimum length of the string
maxlen maximum length of the string
allowed allowed characters
select true for a select-like field, false for a text-like field
Returns:
true if the check was successful, false if not
void base_soap::SOAPInputCheck::compileAllowed ( const base::String allowed,
bool *  alpha,
bool *  digit,
bool *  unicode,
base::String other 
) [protected]

Compiles an allowed character string.

An allowed character string can contain the following tokens:

  • $$ = $
  • $alpha$ = a-z, A-Z
  • $digit$ = 0-9
  • $unicode$ = a-z, A-Z, other unicode characters
  • <other> = <other>
Parameters:
allowed the allowed character string
alpha returns whether alphabetic characters are allowed
digit returns whether digits are allowed
unicode returns whether unicode alphabetic characters are allowed
other returns all other allowed characters

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