|
NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
|
Text processing for string objects. More...
Functions | |
| std::string | trimWhitespace (const std::string &s, const std::locale &locale=std::locale()) |
| Remove leading and trailing whitespace from a string. More... | |
| std::string | ltrimWhitespace (const std::string &s, const std::locale &locale=std::locale()) |
| Remove leading whitespace from a string. More... | |
| std::string | rtrimWhitespace (const std::string &s, const std::locale &locale=std::locale()) |
| Remove trailing whitespace from a string. More... | |
| std::string | trim (const std::string &s, const char trimChar) |
| Remove leading and trailing characters from a string. More... | |
| std::string | ltrim (const std::string &s, const char trimChar) |
| Remove leading characters from a string. More... | |
| std::string | rtrim (const std::string &s, const char trimChar) |
| Remove trailing characters from a string. More... | |
| std::string | digest (const std::string &s, const std::string &digest="md5") |
| Compute the digest of a string. More... | |
| std::string | digest (const void *buffer, const size_t buffer_size, const std::string &digest="md5") |
| Compute the digest of a memory buffer. More... | |
| std::vector< std::string > | split (const std::string &str, const char delimiter, bool escape=true) |
| Return tokens bound by delimiters and the beginning and end of a string. More... | |
| std::string | basename (const std::string &path) |
| Extract the filename component of a pathname. More... | |
| std::string | dirname (const std::string &path) |
| Extract the directory component of a pathname. More... | |
| bool | caseInsensitiveCompare (const std::string &str1, const std::string &str2) |
| Compare two ASCII-encoded strings. More... | |
| std::string | toUppercase (const std::string &str, const std::locale &locale=std::locale()) |
| Uppercase a string, respecting locale. More... | |
| std::string | toLowercase (const std::string &str, const std::locale &locale=std::locale()) |
| Lowercase a string, respecting locale. More... | |
| std::string | encodeBase64 (const BiometricEvaluation::Memory::uint8Array &data) |
| Perform Base64 encoding. More... | |
| BiometricEvaluation::Memory::uint8Array | decodeBase64 (const std::string &data) |
| Perform Base64 decoding. More... | |
Text processing for string objects.
The Text package contains a set of functions for the processing of strings: removing leading and trailing whitespace, computing a digest, and other utility functions.
| std::string BiometricEvaluation::Text::trimWhitespace | ( | const std::string & | s, |
| const std::locale & | locale = std::locale() |
||
| ) |
Remove leading and trailing whitespace from a string.
| s | String object whose leading and trailing whitespace should be removed. |
| locale | Locale to be considered when determining whitespace characters. |
| std::string BiometricEvaluation::Text::ltrimWhitespace | ( | const std::string & | s, |
| const std::locale & | locale = std::locale() |
||
| ) |
Remove leading whitespace from a string.
| s | String object whose leading whitespace should be removed. |
| locale | Locale to be considered when determining whitespace characters. |
| std::string BiometricEvaluation::Text::rtrimWhitespace | ( | const std::string & | s, |
| const std::locale & | locale = std::locale() |
||
| ) |
Remove trailing whitespace from a string.
| s | String object whose trailing whitespace should be removed. |
| locale | Locale to be considered when determining whitespace characters. |
| std::string BiometricEvaluation::Text::trim | ( | const std::string & | s, |
| const char | trimChar | ||
| ) |
Remove leading and trailing characters from a string.
| s | String object whose leading and trailing trimChar should be removed. |
| trimChar | Character to remove from the beginning and ending of s. |
| std::string BiometricEvaluation::Text::ltrim | ( | const std::string & | s, |
| const char | trimChar | ||
| ) |
Remove leading characters from a string.
| s | String object whose leading trimChar should be removed. |
| trimChar | Character to remove from the beginning of s. |
| std::string BiometricEvaluation::Text::rtrim | ( | const std::string & | s, |
| const char | trimChar | ||
| ) |
Remove trailing characters from a string.
| s | String object whose trailing trimChar should be removed. |
| trimChar | Character to remove from the end of s. |
| std::string BiometricEvaluation::Text::digest | ( | const std::string & | s, |
| const std::string & | digest = "md5" |
||
| ) |
Compute the digest of a string.
| [in] | s | The string of which a digest should be computed. |
| [in] | digest | The digest to use. Any digest supported by OpenSSL is valid, and the default is MD5. |
| Error::MemoryError | Could not allocate memory to store digest. |
| Error::NotImplemented | The value of digest is not a supported digest. |
| Error::StrategyError | An error occurred while obtaining the digest. |
| std::string BiometricEvaluation::Text::digest | ( | const void * | buffer, |
| const size_t | buffer_size, | ||
| const std::string & | digest = "md5" |
||
| ) |
Compute the digest of a memory buffer.
| [in] | buffer | The buffer of which a digest should be computed. |
| [in] | buffer_size | The size of buffer. |
| [in] | digest | The digest to use. Any digest supported by OpenSSL is valid, and the default is MD5. |
| Error::MemoryError | Could not allocate memory to store digest. |
| Error::NotImplemented | The value of digest is not a supported digest. |
| Error::StrategyError | An error occurred while obtaining the digest. |
| std::vector< std::string > BiometricEvaluation::Text::split | ( | const std::string & | str, |
| const char | delimiter, | ||
| bool | escape = true |
||
| ) |
Return tokens bound by delimiters and the beginning and end of a string.
| [in] | str | String to tokenize. |
| [in] | delimiter | Character that defines the end of a token. Any are valid, except '\'. |
| [in] | escape | If the delimiter is prefixed with '\' in the string, do not split at that point and remove the '\'. |
| std::string BiometricEvaluation::Text::basename | ( | const std::string & | path | ) |
Extract the filename component of a pathname.
Returns the component following the final ’/’. Trailing ’/’ characters are not counted as part of the pathname.
| [in] | path | Path from which to extract the filename portion. |
| std::string BiometricEvaluation::Text::dirname | ( | const std::string & | path | ) |
Extract the directory component of a pathname.
Returns the string up to, but not including, the final ’/’.
| [in] | path | Path from which to extract the directory portion. |
| bool BiometricEvaluation::Text::caseInsensitiveCompare | ( | const std::string & | str1, |
| const std::string & | str2 | ||
| ) |
Compare two ASCII-encoded strings.
| str1 | First string to compare. |
| str2 | Second string to compare. |
| std::string BiometricEvaluation::Text::toUppercase | ( | const std::string & | str, |
| const std::locale & | locale = std::locale() |
||
| ) |
Uppercase a string, respecting locale.
| str | String to uppercase. |
| locale | Locale to use when uppercasing str. |
| std::string BiometricEvaluation::Text::toLowercase | ( | const std::string & | str, |
| const std::locale & | locale = std::locale() |
||
| ) |
Lowercase a string, respecting locale.
| str | String to loercase. |
| locale | Locale to use when lowercasing str. |
| std::string BiometricEvaluation::Text::encodeBase64 | ( | const BiometricEvaluation::Memory::uint8Array & | data | ) |
Perform Base64 encoding.
| data | Data to encoded. |
| BiometricEvaluation::Memory::uint8Array BiometricEvaluation::Text::decodeBase64 | ( | const std::string & | data | ) |
Perform Base64 decoding.
| data | Base64 data to decode. |