

Go to the source code of this file.
Typedefs | |
| typedef std::tuple< const char *, std::ptrdiff_t, const char *, std::ptrdiff_t > | title_body_type |
Functions | |
| void | escape_javascript (string &result, const char *text, const unsigned int text_size) |
| void | escape_javascript (string &result, const string &text) |
| string | escape_javascript (const string &text) |
| void | escape_html (string &result, const char *text, const unsigned int text_size) |
| Escapes characters in text that could result in rendering HTML when passed to an HTML renderer. | |
| void | escape_html (string &result, const string &text) |
| string | escape_html (const string &text) |
| void | escape_url (string &result, const char *text, const unsigned int text_size) |
| Escapes characters in text that are either reserved or "unsafe" according to RFC 1738. | |
| void | escape_url (string &result, const string &text) |
| string | escape_url (const string &text) |
| void | unescape_url (string &url) |
| Unescapes URL escape sequences in place. | |
| void | strip_html (string &result, const char *text, const unsigned int text_size) |
| Removes all HTML tags from text. | |
| void | strip_html (string &result, const string &text) |
| string | strip_html (const string &text) |
| void | strip_html_and_unescape (string &result, const char *text, const unsigned int text_size) |
| Removes all HTML tags from text and unescapes character entities, converting them into the characters they represent. | |
| string | strip_html_and_unescape (const char *text, const unsigned int text_size) |
| void | strip_html_and_unescape (string &result, const string &text) |
| string | strip_html_and_unescape (const string &text) |
| void | wrap_lines (char *text, const unsigned int text_size, const unsigned int max_length=79) |
| Replaces spaces in text with newlines in such a manner that no line exceeds a specified maximum length, except for sequences of characters uninterrupted by spaces that exceed the maximum line length. | |
| title_body_type | html_title_and_body (const char *begin, const char *end) |
| Returns the offsets of the title and body of an HTML document. | |
Typedef Documentation
| typedef std::tuple<const char *, std::ptrdiff_t, const char *, std::ptrdiff_t> title_body_type |
Definition at line 109 of file WebStrings.h.
Function Documentation
| void escape_html | ( | string & | result, |
| const char * | text, | ||
| const unsigned int | text_size | ||
| ) |
Escapes characters in text that could result in rendering HTML when passed to an HTML renderer.
In addition, all leading and trailing whitespace is removed.
- Parameters:
-
result Buffer in which to store escaped text. The string will be resized to hold the text. text The text to be escaped. text_size The length of the unescaped text.
Definition at line 410 of file WebStrings.cc.
Referenced by escape_html().
| void escape_html | ( | string & | result, |
| const string & | text | ||
| ) | [inline] |
Definition at line 45 of file WebStrings.h.
References escape_html().
| string escape_html | ( | const string & | text | ) | [inline] |
Definition at line 49 of file WebStrings.h.
References escape_html().
| void escape_javascript | ( | string & | result, |
| const char * | text, | ||
| const unsigned int | text_size | ||
| ) |
Definition at line 392 of file WebStrings.cc.
Referenced by escape_javascript().
| void escape_javascript | ( | string & | result, |
| const string & | text | ||
| ) | [inline] |
Definition at line 32 of file WebStrings.h.
References escape_javascript().
| string escape_javascript | ( | const string & | text | ) | [inline] |
Definition at line 36 of file WebStrings.h.
References escape_javascript().
| void escape_url | ( | string & | result, |
| const char * | text, | ||
| const unsigned int | text_size | ||
| ) |
Escapes characters in text that are either reserved or "unsafe" according to RFC 1738.
Trailing spaces are escaped and not trimmed.
- Parameters:
-
result Buffer in which to store escaped text. The string will be resized to hold the text. text The text to be escaped. text_size The length of the unescaped text.
Definition at line 427 of file WebStrings.cc.
Referenced by escape_url().
| void escape_url | ( | string & | result, |
| const string & | text | ||
| ) | [inline] |
Definition at line 58 of file WebStrings.h.
References escape_url().
| string escape_url | ( | const string & | text | ) | [inline] |
Definition at line 62 of file WebStrings.h.
References escape_url().
| title_body_type html_title_and_body | ( | const char * | begin, |
| const char * | end | ||
| ) |
Returns the offsets of the title and body of an HTML document.
Definition at line 603 of file WebStrings.cc.
| void strip_html | ( | string & | result, |
| const char * | text, | ||
| const unsigned int | text_size | ||
| ) |
Removes all HTML tags from text.
- Parameters:
-
result Buffer in which to store stripped text. The string will be resized to hold the text. text The text to be stripped. text_size The length of the unstripped text.
Definition at line 475 of file WebStrings.cc.
Referenced by strip_html().
| void strip_html | ( | string & | result, |
| const string & | text | ||
| ) | [inline] |
Definition at line 73 of file WebStrings.h.
References strip_html().
| string strip_html | ( | const string & | text | ) | [inline] |
Definition at line 77 of file WebStrings.h.
References strip_html().
| void strip_html_and_unescape | ( | string & | result, |
| const char * | text, | ||
| const unsigned int | text_size | ||
| ) |
Removes all HTML tags from text and unescapes character entities, converting them into the characters they represent.
- Parameters:
-
result Buffer in which to store stripped text. The string will be resized to hold the text. text The text to be stripped. text_size The length of the unstripped text.
Definition at line 517 of file WebStrings.cc.
Referenced by strip_html_and_unescape().
| string strip_html_and_unescape | ( | const char * | text, |
| const unsigned int | text_size | ||
| ) | [inline] |
Definition at line 86 of file WebStrings.h.
References strip_html_and_unescape().
| void strip_html_and_unescape | ( | string & | result, |
| const string & | text | ||
| ) | [inline] |
Definition at line 94 of file WebStrings.h.
References strip_html_and_unescape().
| string strip_html_and_unescape | ( | const string & | text | ) | [inline] |
Definition at line 98 of file WebStrings.h.
References strip_html_and_unescape().
| void unescape_url | ( | string & | url | ) |
Unescapes URL escape sequences in place.
- Parameters:
-
url The URL to unescape.
Definition at line 439 of file WebStrings.cc.
References FROM_HEX.
Referenced by parse_query_string().
| void wrap_lines | ( | char * | text, |
| const unsigned int | text_size, | ||
| const unsigned int | max_length | ||
| ) |
Replaces spaces in text with newlines in such a manner that no line exceeds a specified maximum length, except for sequences of characters uninterrupted by spaces that exceed the maximum line length.
- Parameters:
-
text The text to be line-wrapped. text_size The length of the text. max_length The maximum line length.
Definition at line 563 of file WebStrings.cc.