|
xapian-core
2.0.0
|
Various handy string-related helpers. More...
#include <xapian/constinfo.h>#include <algorithm>#include <string>#include <string_view>#include <cstring>
Include dependency graph for stringutils.h:Go to the source code of this file.
Namespaces | |
| Xapian | |
| The Xapian namespace contains public interfaces for the Xapian library. | |
| Xapian::Internal | |
Macros | |
| #define | XAPIAN_IN_XAPIAN_H |
| #define | STRINGIZE_(X) #X |
| Helper macro for STRINGIZE - the nested call is required because of how. More... | |
| #define | STRINGIZE(X) STRINGIZE_(X) |
| The STRINGIZE macro converts its parameter into a string constant. More... | |
| #define | CONST_STRLEN(S) (sizeof(S"") - 1) |
| Returns the length of a string constant. More... | |
Functions | |
| bool | startswith (std::string_view s, char pfx) |
| bool | startswith (std::string_view s, const char *pfx, size_t len) |
| bool | startswith (std::string_view s, const char *pfx) |
| bool | startswith (std::string_view s, std::string_view pfx) |
| bool | endswith (std::string_view s, char sfx) |
| bool | endswith (std::string_view s, const char *sfx, size_t len) |
| bool | endswith (std::string_view s, const char *sfx) |
| bool | endswith (std::string_view s, std::string_view sfx) |
| bool | contains (std::string_view s, char substring) |
| bool | contains (std::string_view s, const char *substring, size_t len) |
| bool | contains (std::string_view s, const char *substring) |
| bool | contains (std::string_view s, std::string_view substring) |
| std::string::size_type | common_prefix_length (std::string_view a, std::string_view b) |
| std::string::size_type | common_prefix_length (std::string_view a, std::string_view b, std::string::size_type max_prefix_len) |
| unsigned char | C_tab_ (char ch) |
| bool | C_isdigit (char ch) |
| bool | C_isxdigit (char ch) |
| bool | C_isupper (char ch) |
| bool | C_islower (char ch) |
| bool | C_isalpha (char ch) |
| bool | C_isalnum (char ch) |
| bool | C_isspace (char ch) |
| bool | C_isnotdigit (char ch) |
| bool | C_isnotxdigit (char ch) |
| bool | C_isnotupper (char ch) |
| bool | C_isnotlower (char ch) |
| bool | C_isnotalpha (char ch) |
| bool | C_isnotalnum (char ch) |
| bool | C_isnotspace (char ch) |
| char | C_tolower (char ch) |
| char | C_toupper (char ch) |
| int | hex_digit (char ch) |
| char | hex_decode (char ch1, char ch2) |
| Decode a pair of ASCII hex digits. More... | |
Variables | |
| const unsigned char | Xapian::Internal::HEX_MASK = 0x0f |
| const unsigned char | Xapian::Internal::IS_UPPER = 0x10 |
| const unsigned char | Xapian::Internal::IS_ALPHA = 0x20 |
| const unsigned char | Xapian::Internal::IS_DIGIT = 0x40 |
| const unsigned char | Xapian::Internal::IS_SPACE = 0x80 |
Various handy string-related helpers.
Definition in file stringutils.h.
| #define CONST_STRLEN | ( | S | ) | (sizeof(S"") - 1) |
Returns the length of a string constant.
We rely on concatenation of string literals to produce an error if this macro is applied to something other than a string literal.
Definition at line 48 of file stringutils.h.
| #define STRINGIZE | ( | X | ) | STRINGIZE_(X) |
The STRINGIZE macro converts its parameter into a string constant.
Definition at line 41 of file stringutils.h.
| #define STRINGIZE_ | ( | X | ) | #X |
Helper macro for STRINGIZE - the nested call is required because of how.
Definition at line 38 of file stringutils.h.
| #define XAPIAN_IN_XAPIAN_H |
Definition at line 26 of file stringutils.h.
|
inline |
Definition at line 208 of file stringutils.h.
References C_tab_(), Xapian::Internal::IS_ALPHA, and Xapian::Internal::IS_DIGIT.
Referenced by C_isnotalnum(), munge_term(), and test_chartype1().
|
inline |
Definition at line 203 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_ALPHA.
Referenced by C_isnotalpha(), and test_chartype1().
|
inline |
Definition at line 182 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_DIGIT.
Referenced by C_isnotdigit(), Xapian::decode_xxy(), and test_chartype1().
|
inline |
Definition at line 198 of file stringutils.h.
References C_tab_(), Xapian::Internal::IS_ALPHA, and Xapian::Internal::IS_UPPER.
Referenced by C_isnotlower(), and test_chartype1().
|
inline |
Definition at line 223 of file stringutils.h.
References C_isalnum().
Referenced by test_chartype1().
|
inline |
Definition at line 222 of file stringutils.h.
References C_isalpha().
Referenced by test_chartype1().
|
inline |
Definition at line 218 of file stringutils.h.
References C_isdigit().
Referenced by test_chartype1().
|
inline |
Definition at line 221 of file stringutils.h.
References C_islower().
Referenced by test_chartype1().
|
inline |
Definition at line 224 of file stringutils.h.
References C_isspace().
Referenced by get_paragraph(), FileIndexer::index_to(), make_tg_db(), and test_chartype1().
|
inline |
Definition at line 220 of file stringutils.h.
References C_isupper().
Referenced by test_chartype1().
|
inline |
Definition at line 219 of file stringutils.h.
References C_isxdigit().
Referenced by test_chartype1().
|
inline |
Definition at line 213 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_SPACE.
Referenced by C_isnotspace(), Xapian::Weight::Internal::double_param(), FileIndexer::index_to(), stdout_to_string(), and test_chartype1().
|
inline |
Definition at line 193 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_UPPER.
Referenced by C_isnotupper(), and test_chartype1().
|
inline |
Definition at line 187 of file stringutils.h.
References C_tab_(), Xapian::Internal::HEX_MASK, and Xapian::Internal::IS_DIGIT.
Referenced by C_isnotxdigit(), munge_term(), test_chartype1(), and unescape().
|
inline |
Definition at line 177 of file stringutils.h.
References Xapian::Internal::constinfo::C_tab, and Xapian::Internal::get_constinfo_().
Referenced by C_isalnum(), C_isalpha(), C_isdigit(), C_islower(), C_isspace(), C_isupper(), C_isxdigit(), C_tolower(), C_toupper(), and hex_digit().
|
inline |
Definition at line 226 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_ALPHA.
Referenced by check_db_table(), munge_term(), and HostFieldProcessor::operator()().
|
inline |
Definition at line 231 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_ALPHA.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 128 of file stringutils.h.
Referenced by HoneyTable::add(), PrefixCompressedStringWriter::append(), SSTIndex::maybe_add_entry(), RemoteServer::msg_allterms(), RemoteServer::msg_metadatakeylist(), RemoteServer::msg_synonymkeylist(), RemoteServer::msg_synonymtermlist(), RemoteServer::msg_termlist(), serialise_stats(), GlassTermListTable::set_termlist(), and HoneyTermListTable::set_termlist().
|
inline |
Definition at line 139 of file stringutils.h.
|
inline |
Definition at line 104 of file stringutils.h.
Referenced by Xapian::RSet::contains(), and DEFINE_TESTCASE().
|
inline |
Definition at line 116 of file stringutils.h.
|
inline |
Definition at line 110 of file stringutils.h.
|
inline |
Definition at line 122 of file stringutils.h.
|
inline |
Definition at line 80 of file stringutils.h.
Referenced by Xapian::Database::check_(), Xapian::check_byte_unit(), Xapian::RangeProcessor::check_range(), endswith(), test_driver::get_srcdir(), main(), and Xapian::Internal::QueryWildcard::test_prefix_known().
|
inline |
Definition at line 92 of file stringutils.h.
References endswith().
|
inline |
Definition at line 86 of file stringutils.h.
|
inline |
Definition at line 98 of file stringutils.h.
References endswith().
|
inline |
Decode a pair of ASCII hex digits.
E.g. hex_decode('4', 'A') gives 'J'.
If C_isxdigit(ch1) isn't true then ch1 is treated as '0', and similarly for ch2.
Definition at line 248 of file stringutils.h.
References hex_digit().
Referenced by munge_term(), Uuid::parse(), test_chartype1(), and unescape().
|
inline |
Definition at line 236 of file stringutils.h.
References C_tab_(), and Xapian::Internal::HEX_MASK.
Referenced by hex_decode(), and test_chartype1().
|
inline |
Definition at line 56 of file stringutils.h.
Referenced by GlassDatabaseReplicator::apply_changeset_from_conn(), TermGroup::as_group(), Xapian::RangeProcessor::check_range(), DEFINE_TESTCASE(), Xapian::Internal::Context::expand_edit_distance(), test_driver::get_srcdir(), main(), SSTIndex::maybe_add_entry(), GlassAllTermsList::next(), GlassMetadataTermList::next(), GlassSynonymTermList::next(), HoneyAllTermsList::next(), HoneyCompact::PostlistCursor< const GlassTable & >::next(), HoneyMetadataTermList::next(), HoneySynonymTermList::next(), InMemoryAllTermsList::next(), Xapian::ExpandDeciderFilterPrefix::operator()(), pretty_ip6(), skip_test_for_backend(), skip_test_unless_backend(), GlassMetadataTermList::skip_to(), HoneyMetadataTermList::skip_to(), HoneyAllTermsList::skip_to(), HoneySynonymTermList::skip_to(), GlassAllTermsList::skip_to(), GlassSynonymTermList::skip_to(), InMemoryAllTermsList::skip_to(), startswith(), Xapian::Internal::QueryWildcard::test(), TestRunner::use_backend(), and XFAIL_FOR_BACKEND().
|
inline |
Definition at line 68 of file stringutils.h.
References startswith().
|
inline |
Definition at line 62 of file stringutils.h.
|
inline |
Definition at line 74 of file stringutils.h.
References startswith().