/home/koen/project/wt/cvs/wt/examples/form/DateValidator.h

Go to the documentation of this file.
00001 // This may look like C code, but it's really -*- C++ -*-
00002 /*
00003  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
00004  *
00005  * See the LICENSE file for terms of use.
00006  */
00007 
00008 #ifndef DATE_VALIDATOR_H_
00009 #define DATE_VALIDATOR_H_
00010 
00011 #include <boost/date_time/gregorian/gregorian_types.hpp>
00012 
00013 #include <WRegExpValidator>
00014 
00015 using namespace Wt;
00016 
00021 
00033 class DateValidator : public WRegExpValidator
00034 {
00035 public:
00040   DateValidator(const boost::gregorian::date& bottom,
00041                 const boost::gregorian::date& top);
00042 
00043   /*
00044    * Reimplement the validate method to check the validity of
00045    * input as an existing date.
00046    */
00047   virtual State validate(WString& input, int& pos) const;
00048 
00049 private:
00050   boost::gregorian::date bottom_, top_;
00051 };
00052 
00055 #endif // DATE_VALIDATOR_H_

Generated on Mon Apr 14 15:15:04 2008 for Wt by doxygen 1.5.3