xapian-core
1.4.22
|
Various handy helpers which std::string really should provide. More...
Go to the source code of this file.
Namespaces | |
Xapian | |
The Xapian namespace contains public interfaces for the Xapian library. | |
Xapian::Internal | |
Macros | |
#define | STRINGIZE_(X) #X |
Helper macro for STRINGIZE - the nested call is required because of how works in macros.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 (const std::string &s, char pfx) |
bool | startswith (const std::string &s, const char *pfx, size_t len) |
bool | startswith (const std::string &s, const char *pfx) |
bool | startswith (const std::string &s, const std::string &pfx) |
bool | endswith (const std::string &s, char sfx) |
bool | endswith (const std::string &s, const char *sfx, size_t len) |
bool | endswith (const std::string &s, const char *sfx) |
bool | endswith (const std::string &s, const std::string &sfx) |
std::string::size_type | common_prefix_length (const std::string &a, const std::string &b) |
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 helpers which std::string really should provide.
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 43 of file stringutils.h.
Referenced by ChertDatabaseReplicator::apply_changeset_from_conn(), GlassDatabaseReplicator::apply_changeset_from_conn(), FDTracker::check(), GlassChanges::check(), GlassDatabase::get_changeset_revisions(), ChertDatabase::get_changeset_revisions(), main(), and GlassDatabaseReplicator::process_changeset_chunk_blocks().
#define STRINGIZE | ( | X | ) | STRINGIZE_(X) |
The STRINGIZE macro converts its parameter into a string constant.
Definition at line 36 of file stringutils.h.
Referenced by GlassWritableDatabase::add_document_(), ChertWritableDatabase::add_document_(), Glass::LeafItem_wr::form_key(), Item_wr::form_key(), ChertVersion::read_and_check(), GlassWritableDatabase::replace_document(), ChertWritableDatabase::replace_document(), show_usage(), ChertTable::split_root(), GlassTable::split_root(), and RemoteDatabase::update_stats().
#define STRINGIZE_ | ( | X | ) | #X |
Helper macro for STRINGIZE - the nested call is required because of how
Definition at line 33 of file stringutils.h.
|
inline |
Definition at line 160 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 155 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_ALPHA.
Referenced by C_isnotalpha(), and test_chartype1().
|
inline |
Definition at line 134 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_DIGIT.
Referenced by C_isnotdigit(), and test_chartype1().
|
inline |
Definition at line 150 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 175 of file stringutils.h.
References C_isalnum().
Referenced by test_chartype1().
|
inline |
Definition at line 174 of file stringutils.h.
References C_isalpha().
Referenced by test_chartype1().
|
inline |
Definition at line 170 of file stringutils.h.
References C_isdigit().
Referenced by test_chartype1().
|
inline |
Definition at line 173 of file stringutils.h.
References C_islower().
Referenced by test_chartype1().
|
inline |
Definition at line 176 of file stringutils.h.
References C_isspace().
Referenced by get_paragraph(), FileIndexer::index_to(), make_tg_db(), and test_chartype1().
|
inline |
Definition at line 172 of file stringutils.h.
References C_isupper().
Referenced by test_chartype1().
|
inline |
Definition at line 171 of file stringutils.h.
References C_isxdigit().
Referenced by test_chartype1().
|
inline |
Definition at line 165 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_SPACE.
Referenced by C_isnotspace(), FileIndexer::index_to(), stdout_to_string(), and test_chartype1().
|
inline |
Definition at line 145 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_UPPER.
Referenced by C_isnotupper(), and test_chartype1().
|
inline |
Definition at line 139 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 129 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 178 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 183 of file stringutils.h.
References C_tab_(), and Xapian::Internal::IS_ALPHA.
Referenced by Xapian::QueryParser::Internal::parse_query().
|
inline |
Definition at line 94 of file stringutils.h.
Referenced by RemoteServer::msg_allterms(), RemoteServer::msg_openmetadatakeylist(), RemoteServer::msg_termlist(), ChertTermListTable::set_termlist(), and GlassTermListTable::set_termlist().
|
inline |
Definition at line 70 of file stringutils.h.
Referenced by Xapian::Database::check_(), Xapian::RangeProcessor::check_range(), DEFINE_TESTCASE(), endswith(), test_driver::get_srcdir(), main(), and Xapian::StringValueRangeProcessor::operator()().
|
inline |
Definition at line 76 of file stringutils.h.
|
inline |
Definition at line 82 of file stringutils.h.
References endswith().
|
inline |
Definition at line 88 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 200 of file stringutils.h.
References hex_digit().
Referenced by munge_term(), Uuid::parse(), test_chartype1(), and unescape().
|
inline |
Definition at line 188 of file stringutils.h.
References C_tab_(), and Xapian::Internal::HEX_MASK.
Referenced by hex_decode(), and test_chartype1().
|
inline |
Definition at line 46 of file stringutils.h.
Referenced by ChertDatabaseReplicator::apply_changeset_from_conn(), GlassDatabaseReplicator::apply_changeset_from_conn(), TermGroup::as_group(), Xapian::RangeProcessor::check_range(), DEFINE_TESTCASE(), Xapian::Internal::QueryBranch::do_synonym(), test_driver::get_srcdir(), ChertMetadataTermList::get_termname(), GlassMetadataTermList::get_termname(), main(), InMemoryAllTermsList::next(), ChertMetadataTermList::next(), GlassMetadataTermList::next(), GlassSpellingWordsList::next(), ChertSpellingWordsList::next(), ChertAllTermsList::next(), GlassAllTermsList::next(), ChertSynonymTermList::next(), GlassSynonymTermList::next(), Xapian::ExpandDeciderFilterPrefix::operator()(), Xapian::StringValueRangeProcessor::operator()(), AuthorValueRangeProcessor::operator()(), skip_test_for_backend(), skip_test_unless_backend(), InMemoryAllTermsList::skip_to(), GlassMetadataTermList::skip_to(), ChertMetadataTermList::skip_to(), GlassSpellingWordsList::skip_to(), ChertSpellingWordsList::skip_to(), GlassAllTermsList::skip_to(), ChertAllTermsList::skip_to(), ChertSynonymTermList::skip_to(), GlassSynonymTermList::skip_to(), Xapian::MSet::Internal::snippet(), startswith(), TestRunner::use_backend(), and XFAIL_FOR_BACKEND().
|
inline |
Definition at line 52 of file stringutils.h.
|
inline |
Definition at line 58 of file stringutils.h.
References startswith().
|
inline |
Definition at line 64 of file stringutils.h.
References startswith().