#include "wvstring.h"
#include "wvstringlist.h"
Go to the source code of this file.
Functions | |
char * | terminate_string (char *string, char c) |
char * | trim_string (char *string) |
char * | trim_string (char *string, char c) |
void | replace_char (void *string, char c1, char c2, int length) |
char * | strlwr (char *string) |
char * | strupr (char *string) |
bool | is_word (const char *string) |
WvString | hexdump_buffer (const void *buf, size_t len) |
bool | isnewline (char c) |
void | hexify (char *obuf, const void *ibuf, size_t len) |
void | unhexify (void *obuf, const char *ibuf) |
WvString | web_unescape (const char *str) |
WvString | rfc822_date (time_t _when=-1) |
WvString | passwd_crypt (const char *str) |
WvString | backslash_escape (const WvString &s1) |
int | strcount (const WvString &s, const char c) |
WvString | encode_hostname_as_DN (WvString &hostname) |
|
Definition at line 277 of file strutils.cc. References WvString::edit(), WvString::len(), and WvString::setsize(). |
|
Definition at line 311 of file strutils.cc. References WvString::append(), WvString::edit(), WvStringList::split(), and WvString::unique(). |
|
Produce a hexadecimal dump of the data buffer in 'buf' of length 'len'. It is formatted with 16 bytes per line; each line has an address offset, hex representation, and printable representation. This is used mostly for debugging purposes. You can send the returned WvString object directly to a WvLog or any other WvStream for output. Definition at line 132 of file strutils.cc. References WvString::edit(), and WvString::setsize(). |
|
Write the contents of the binary string of length 'len' pointed to by 'ibuf' into the output buffer 'obuf' in hexadecimal format. For example, if len==4, ibuf=="ABCDEF", then obuf will contain "41424344" with a terminating NUL character. This is useful to turn arbitrary binary into a simple printable format, so that it can (for example) be written to a WvConf configuration file. obuf must be a buffer with at least (len * 2) + 1 bytes available. (two digits for each byte of ibuf, plus a terminating NUL). Definition at line 191 of file strutils.cc. Referenced by WvX509Mgr::encodecert(), and WvRSAKey::WvRSAKey(). |
|
Returns true if all characters in 'string' are isalnum() (alphanumeric). Definition at line 117 of file strutils.cc. |
|
Returns true if 'c' is a newline or carriage return character. Increases code readability a bit. Definition at line 184 of file strutils.cc. |
|
Definition at line 9 of file strcrypt.cc. References WvString::unique(). |
|
Replace all instances of c1 with c2 for the first 'length' characters in 'string'. Ignores terminating NUL, so make sure you set 'length' correctly. Definition at line 79 of file strutils.cc. |
|
Definition at line 262 of file strutils.cc. References WvString::edit(), and WvString::setsize(). |
|
Definition at line 301 of file strutils.cc. |
|
In-place modify a character string so that all contained letters are in lower case. Returns 'string'. Definition at line 90 of file strutils.cc. Referenced by set_name_entry(). |
|
In-place modify a character string so that all contained letters are in upper case. Returns 'string'. Definition at line 102 of file strutils.cc. |
|
Add character c to the end of a string after removing terminating carriage returns/linefeeds if any. You need a buffer that's at least one character bigger than the current length of the string, including the terminating NULL. Definition at line 15 of file strutils.cc. |
|
Similar to above, but trims the string starting at the first occurrence of c. Definition at line 59 of file strutils.cc. Referenced by WvLogBuffer::_end_line(), WvStringTable::join(), WvStringList::join(), WvConf::load_file(), WvLockFile::lock(), WvConf::parse_section(), WvConf::parse_value(), set_name_entry(), WvProtoStream::token_remaining(), WvProtoStream::tokline(), WvHTTPStream::uread(), and web_unescape(). |
|
Trims whitespace from the beginning and end of the character string, including carriage return / linefeed characters. Modifies the string in place. Returns the new first character of the string, which points either at 'string' itself or some character contained therein. string is allowed to be NULL; returns NULL in that case. |
|
Reverse the operation performed by hexify(). obuf must be a buffer large enough to contain the entire binary output string; you can calculate this size with (strlen(ibuf) / 2). obuf will NOT be automatically NUL-terminated. Definition at line 205 of file strutils.cc. Referenced by WvX509Mgr::decodecert(), and WvRSAKey::WvRSAKey(). |
|
Converts escaped characters (things like %20 etc.) from web URLS into their normal ASCII representations. Definition at line 226 of file strutils.cc. References WvString::edit(), WvString::setsize(), and trim_string(). |