VMime
|
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 |
Referenced by maildirMessage::fetchPartHeader(), and outputStreamStringAdapter::writeImpl().
Casts a string to bytes.
str | string |
Referenced by IMAPFolder::addMessage().
|
static |
Casts a NULL-terminated string to bytes.
str | string |
|
static |
Return the number of 7-bit US-ASCII characters in a string.
begin | start position |
end | end position |
References vmime::count(), vmime::end(), and parserHelpers::isAscii().
Referenced by text::createFromString(), wordEncoder::guessBestEncoding(), and stringUtils::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(), parserHelpers::isAscii(), and vmime::npos.
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 stringUtils::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==(), relay::parseImpl(), charset::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 |
Makes a string from bytes.
data | pointer to buffer containing data |
count | number of bytes to use from buffer |
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 |
References vmime::npos.
|
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. '\') |
References vmime::npos.
Transform all the characters in a string to lower-case.
str | the string to transform |
Referenced by fetchAttributes::add(), disposition::addModifier(), messageDigestFactory::create(), headerFieldFactory::create(), headerFieldFactory::createValue(), header::findAllFields(), header::findField(), parameterizedHeaderField::findParameter(), encoderFactory::getEncoderByName(), header::getField(), importanceHelper::getImportanceHeader(), parameterizedHeaderField::getParameter(), charset::getRecommendedEncoding(), serviceFactory::getServiceByProtocol(), propertySet::property::getValue(), fetchAttributes::has(), header::hasField(), disposition::hasModifier(), parameterizedHeaderField::hasParameter(), headerFieldFactory::isValueTypeValid(), contentDisposition::operator=(), encoding::operator=(), contentDisposition::operator==(), encoding::operator==(), contentDisposition::parseImpl(), mediaType::parseImpl(), encoding::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(), contentDisposition::parseImpl(), mediaType::parseImpl(), charset::parseImpl(), encoding::parseImpl(), mailboxGroup::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().