Public Member Functions | List of all members
cppcms::widgets::regex_field Class Reference

This class is extending a simple text widget by using additional regular expression validation. More...

#include <cppcms/form.h>

Inheritance diagram for cppcms::widgets::regex_field:
cppcms::widgets::text cppcms::widgets::base_html_input cppcms::widgets::base_text cppcms::widgets::base_widget cppcms::widgets::base_widget cppcms::base_form booster::noncopyable cppcms::base_form booster::noncopyable cppcms::form_flags cppcms::form_flags cppcms::widgets::email

Public Member Functions

 regex_field (booster::regex const &e)
 regex_field (std::string const &e)
void regex (booster::regex const &e)
virtual bool validate ()
- Public Member Functions inherited from cppcms::widgets::text
 text ()
 text (std::string const &type)
void size (int n)
int size ()
virtual void render_attributes (form_context &context)
virtual void render_value (form_context &context)
- Public Member Functions inherited from cppcms::widgets::base_html_input
 base_html_input (std::string const &type)
virtual ~base_html_input ()
virtual void render_input (form_context &context)
- Public Member Functions inherited from cppcms::widgets::base_widget
 base_widget ()
bool set ()
bool valid ()
std::string id ()
std::string name ()
locale::message message ()
bool has_message ()
locale::message error_message ()
bool has_error_message ()
locale::message help ()
bool has_help ()
bool disabled ()
void disabled (bool)
bool readonly ()
void readonly (bool)
std::string attributes_string ()
void set (bool)
void valid (bool)
void id (std::string)
void name (std::string)
void message (std::string)
void message (locale::message const &)
void error_message (std::string)
void error_message (locale::message const &)
void help (std::string)
void help (locale::message const &msg)
void attributes_string (std::string v)
virtual void render (form_context &context)
virtual void clear ()
virtual void parent (base_form *subform)
virtual formparent ()
void pre_load (http::context &)
- Public Member Functions inherited from cppcms::widgets::base_text
std::string value ()
void value (std::string v)
void non_empty ()
void limits (int min, int max)
std::pair< int, int > limits ()
void validate_charset (bool)
bool validate_charset ()
virtual void load (http::context &)

Additional Inherited Members

- Public Types inherited from cppcms::form_flags
enum  html_type { as_html = 0, as_xhtml = 1 }
enum  html_list_type {
  as_p = 0, as_table = 1, as_ul = 2, as_dl = 3,
  as_space = 4
enum  widget_part_type { first_part = 0, second_part = 1 }
- Protected Member Functions inherited from cppcms::widgets::base_widget
void auto_generate (form_context *context=0)

Detailed Description

This class is extending a simple text widget by using additional regular expression validation.

Constructor & Destructor Documentation

cppcms::widgets::regex_field::regex_field ( booster::regex const &  e)

Create a widget using the regular expression e.

cppcms::widgets::regex_field::regex_field ( std::string const &  e)

Create a widget using the regular expression e.

Member Function Documentation

void cppcms::widgets::regex_field::regex ( booster::regex const &  e)

Set the regular expression.

virtual bool cppcms::widgets::regex_field::validate ( )

Validate the widget content according to the rules and to the charset encoding.


  • The charset validation is very efficient for variable length UTF-8 encoding as well as for most popular fixed length encodings like ISO-8859-*, windows-125* and koi8*. For other encodings, character set conversion is used for the actual validation.
  • Special characters (that are not allowed in HTML) are assumed to be forbidden, even if they are valid code points (like NUL = 0 or DEL=127).

Reimplemented from cppcms::widgets::base_text.

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