|
VMime
|
#include <stringUtils.hpp>
Static Public Member Functions | |
| static const string | makeStringFromBytes (const byte_t *data, const size_t count) |
| static const byte_t * | bytesFromString (const string &str) |
| static const byte_t * | bytesFromString (const char *str) |
| static string & | appendBytesToString (string &str, const byte_t *data, const size_t count) |
| static bool | isStringEqualNoCase (const string &s1, const char *s2, const size_t n) |
| static bool | isStringEqualNoCase (const string &s1, const string &s2) |
| static bool | isStringEqualNoCase (const string::const_iterator begin, const string::const_iterator end, const char *s, const size_t n) |
| static const string | toLower (const string &str) |
| static const string | toUpper (const string &str) |
| static const string | trim (const string &str) |
| static size_t | countASCIIchars (const string::const_iterator begin, const string::const_iterator end) |
| static bool | is7bit (const string &str) |
| static size_t | findFirstNonASCIIchar (const string::const_iterator begin, const string::const_iterator end) |
| template<class TYPE> | |
| static const string | toString (const TYPE &value) |
| template<class TYPE> | |
| static const TYPE | fromString (const string &value) |
| static const string | unquote (const string &str) |
| static bool | needQuoting (const string &str, const string &specialChars=" \t\"(),:;<>@[\\]") |
| static string | quote (const string &str, const string &escapeSpecialChars, const string &escapeChar) |
Miscellaneous functions related to strings.
Appends bytes to a string.
| str | string to which append data |
| data | pointer to buffer containing data |
| count | number of bytes to use from buffer |
References vmime::count().
Referenced by maildirMessage::fetchPartHeader(), and outputStreamStringAdapter::writeImpl().
|
static |
Casts a NULL-terminated string to bytes.
| str | string |
Casts a string to bytes.
| str | string |
Referenced by IMAPFolder::addMessage().
|
static |
Return the number of 7-bit US-ASCII characters in a string.
| begin | start position |
| end | end position |
References vmime::begin(), vmime::count(), vmime::end(), and parserHelpers::isAscii().
Referenced by text::createFromString(), parameter::getGeneratedSize(), wordEncoder::guessBestEncoding(), and is7bit().
|
static |
Returns the position of the first non 7-bit US-ASCII character in a string.
| begin | start position |
| end | end position |
References vmime::begin(), vmime::end(), and parserHelpers::isAscii().
Referenced by wordEncoder::isEncodingNeeded().
|
static |
Convert the specified string value to a value of the specified type.
| value | value to convert |
|
static |
Returns whether the specified string is composed exclusively of 7-bit ASCII characters.
| str | string to test |
References countASCIIchars().
Referenced by charsetConverter_idna::convert(), and emailAddress::generateImpl().
Test two strings for equality (case insensitive).
| s1 | first string |
| s2 | second string (must be in lower-case!) |
| n | length of the second string |
Referenced by charset::charset(), charset::operator==(), charset::parseImpl(), relay::parseImpl(), and transport::processHeaderField().
Test two strings for equality (case insensitive).
| s1 | first string |
| s2 | second string |
References vmime::end().
|
static |
Test two strings for equality (case insensitive).
| begin | start position of the first string |
| end | end position of the first string |
| s | second string (must be in lower-case!) |
| n | length of the second string |
References vmime::begin(), and vmime::end().
Makes a string from bytes.
| data | pointer to buffer containing data |
| count | number of bytes to use from buffer |
References vmime::count().
Referenced by SASLSocket::receive().
Determines whether the specified string needs to be quoted.
| str | string to test |
| specialChars | list of characters that will cause the string to be quoted |
|
static |
Quotes the specified string.
| str | string to quote |
| escapeSpecialChars | list of characters that will be escaped |
| escapeChar | character that will be used for escaping (eg. '\') |
Transform all the characters in a string to lower-case.
| str | the string to transform |
Referenced by fetchAttributes::add(), disposition::addModifier(), headerFieldFactory::create(), messageDigestFactory::create(), headerFieldFactory::createValue(), header::findAllFields(), header::findField(), parameterizedHeaderField::findParameter(), encoderFactory::getEncoderByName(), header::getField(), importanceHelper::getImportanceHeader(), parameterizedHeaderField::getParameter(), charset::getRecommendedEncoding(), serviceFactory::getServiceByProtocol(), fetchAttributes::has(), header::hasField(), disposition::hasModifier(), parameterizedHeaderField::hasParameter(), headerFieldFactory::isValueTypeValid(), contentDisposition::operator=(), encoding::operator=(), contentDisposition::operator==(), encoding::operator==(), contentDisposition::parseImpl(), encoding::parseImpl(), mediaType::parseImpl(), messageDigestFactory::registerAlgorithm(), headerFieldFactory::registerField(), headerFieldFactory::registerFieldValue(), encoderFactory::registerName(), disposition::removeModifier(), mediaType::setSubType(), mediaType::setType(), and propertySet::valueFromString().
|
static |
Convert the specified value to a string value.
| value | to convert |
Referenced by messageSet::byUID().
Transform all the characters in a string to upper-case.
| str | the string to transform |
Referenced by SASLMechanismFactory::create().
Strip the space characters (SPC, TAB, CR, LF) at the beginning and at the end of the specified string.
| str | string in which to strip spaces |
References parserHelpers::isSpace().
Referenced by disposition::generateImpl(), importanceHelper::getImportanceHeader(), maildirStore::isValidFolderName(), charset::parseImpl(), contentDisposition::parseImpl(), encoding::parseImpl(), mailboxGroup::parseImpl(), mediaType::parseImpl(), and POP3Response::readMultilineResponse().
Unquote the specified string and transform escaped characters.
| str | string from which to remove quotes |
References vmime::end().
Referenced by encoding::parseImpl().