|
| int | compare_title_order (const std::string &a, const std::string &b) |
| | Compare titles, ignoring 'a', 'an', or 'the'. More...
|
| |
| bool | compare_titles (const std::string &astr, const std::string &bstr) |
| | Compare titles, ignoring 'a', 'an', or 'the'. More...
|
| |
| bool | compare_person_or_title (const std::string &astr, const std::string &bstr) |
| | Compare an artist's name, which might be a person's name or a band. More...
|
| |
| lamerkey_t | create_key_from_string (const char *source) |
| | Generate a key from a string. More...
|
| |
| lamerkey_t | compute_crc (const char *data, lamerkey_t divisor, lamerkey_t remainder=0) |
| | Compute a key from a string using a CRC algorithm. More...
|
| |
| char * | lamer_cipher (const char *keystr, const char *item) |
| | Encipher or decipher an item based on a key. More...
|
| |
| std::string | lamer_cipher (const std::string &keystr, const std::string &item) |
| |
| lamerkey_t | create_key_from_string (const std::string &source) |
| |
| int | strcasecmp (const std::string &a, const char *b) |
| |
| int | strcasecmp (const char *a, const std::string &b) |
| |
| int | strcasecmp (const std::string &a, const std::string &b) |
| |
| int | strncasecmp (const std::string &a, const char *b, size_t n) |
| |
| int | strncasecmp (const char *a, const std::string &b, size_t n) |
| |
| int | strncasecmp (const std::string &a, const std::string &b, size_t n) |
| |
| const char * | strcasestr (const std::string &a, const char *b) |
| |
| const char * | strcasestr (const char *a, const std::string &b) |
| |
| const char * | strcasestr (const std::string &a, const std::string &b) |
| |
| std::string | strtolower (std::string str) |
| |
| std::string & | ltrim (std::string &s) |
| | Trim whitespace from beginning of a string. More...
|
| |
| std::string & | rtrim (std::string &s) |
| | Trim whitespace from end of a string. More...
|
| |
| std::string & | trim (std::string &s) |
| | Trim whitespace from both ends of a string. More...
|
| |
| std::string | trim (const std::string &s) |
| |
| std::string | makeIdentity (std::string s) |
| | Remove whitespace and other desireable characters, and make all lowercase for use as an ID. More...
|
| |
| std::vector< std::string > | split_string (const std::string &value) |
| | Split a string to words. More...
|
| |
| std::vector< std::string > | split_string (const std::string &value, const std::string separator, bool include_empty_last=true) |
| | Split a string on a fixed pattern. More...
|
| |
| std::string | join_strings (const std::vector< std::string > &list, const std::string joiner) |
| | Join strings together. More...
|
| |
| std::string | join_strings (const std::vector< std::string > &list) |
| | Joing strings together using a space between concatenated values. More...
|
| |
Various helpful templates, classes and functions.
- pianod
- Author
- Perette Barella
- Date
- 2015-12-08
- Copyright
- Copyright (c) 2014-2022 Devious Fish. All rights reserved.
| bool compare_person_or_title |
( |
const std::string & |
astr, |
|
|
const std::string & |
bstr |
|
) |
| |
Compare an artist's name, which might be a person's name or a band.
If it's a title, it may have 'a', 'an', or 'the', or maybe not. If it's a person, it may be /first last/ or /last, first/.
- Parameters
-
| astr | First title. |
| bstr | Second title. |
- Returns
- true if values are equivalent, false if not.
- Warning
- Because this function guesses type of name by looking at the parameters, int return would not be sort-consistent. Thus, return type bool.