SOAPInputCheck.h

00001 // $Id: SOAPInputCheck.h 21 2010-09-05 04:18:17Z cschwarz1 $
00002 
00003 #ifndef BASE_SOAP_SOAPINPUTCHECK_H
00004 #define BASE_SOAP_SOAPINPUTCHECK_H
00005 
00006 #include <vector>
00007 #include "libppbase/base/DNS.h"
00008 #include "SOAPResponse.h"
00009 
00010 namespace base_soap {
00012 
00016     class PPBASE_SOAP_EXPORT SOAPInputCheck: public std::vector<SOAPException> {
00017     public:
00019 
00023         bool addToResponse(SOAPResponse *response);
00024 
00026 
00033         bool checkEmail(const base::String &name, const base::String &value, size_t minlen, size_t maxlen);
00034 
00036 
00043         bool checkFile(const base::String &name, base::MemFile *file, size_t minsize, size_t maxsize);
00044 
00046 
00053         bool checkPhone(const base::String &name, const base::String &value, size_t minlen, size_t maxlen);
00054 
00056 
00065         bool checkNumber(const base::String &name, const base::String &value, size_t minlen, size_t maxlen, size_t precision, bool sign);
00066 
00068 
00077         bool checkString(const base::String &name, const base::String &value, size_t minlen, size_t maxlen, const base::String &allowed = "", bool select = false);
00078 
00079     protected:
00081 
00094         void compileAllowed(const base::String &allowed, bool *alpha, bool *digit, bool *unicode, base::String &other);
00095 
00096         base::DNS _dns;   
00097     };
00098 }
00099 
00100 #endif