Tkrzw
|
Common implementation components for database managers. More...
#include <string>
#include <string_view>
#include <cinttypes>
#include <cstdarg>
#include "tkrzw_dbm.h"
#include "tkrzw_file.h"
#include "tkrzw_lib_common.h"
Namespaces | |
tkrzw | |
Common namespace of Tkrzw. | |
Functions | |
uint64_t | tkrzw::PrimaryHash (std::string_view data, uint64_t num_buckets) |
Primary hash function for the hash database. More... | |
uint64_t | tkrzw::SecondaryHash (std::string_view data, uint64_t num_shards) |
Secondary hash function for sharding. More... | |
uint64_t | tkrzw::IsPrimeNumber (uint64_t num) |
Returns true if an integer is a prime number. More... | |
int64_t | tkrzw::GetHashBucketSize (int64_t min_size) |
Gets a proper bucket size for hashing. More... | |
Status | tkrzw::SearchDBM (DBM *dbm, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool(*matcher)(std::string_view, std::string_view)=StrContains) |
Searches a database and get keys which match a pattern. More... | |
Status | tkrzw::SearchDBMForwardMatch (DBM *dbm, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0) |
Searches a database and get keys which begin with a pattern. More... | |
Status | tkrzw::SearchDBMRegex (DBM *dbm, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool utf=false) |
Searches a database and get keys which match a regular expression. More... | |
Status | tkrzw::SearchDBMEditDistance (DBM *dbm, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool utf=false) |
Searches a database and get keys whose edit distance with a pattern is the least. More... | |
Status | tkrzw::ExportDBMRecordsToFlatRecords (DBM *dbm, File *file) |
Exports all records of a database to a flat record file. More... | |
Status | tkrzw::ImportDBMRecordsFromFlatRecords (DBM *dbm, File *file) |
Imports records to a database from a flat record file. More... | |
Status | tkrzw::ExportDBMKeysToFlatRecords (DBM *dbm, File *file) |
Exports the keys of all records of a database to a flat record file. More... | |
Status | tkrzw::ExportDBMRecordsToTSV (DBM *dbm, File *file, bool escape=false) |
Exports all records of a database to a TSV file. More... | |
Status | tkrzw::ImportDBMRecordsFromTSV (DBM *dbm, File *file, bool unescape=false) |
Imports records to a database from a TSV file. More... | |
Status | tkrzw::ExportDBMKeysAsLines (DBM *dbm, File *file) |
Exports the keys of all records of a database as lines to a text file. More... | |
Status | tkrzw::SearchTextFile (File *file, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool(*matcher)(std::string_view, std::string_view)=StrContains) |
Searches a text file and get lines which match a pattern. More... | |
Status | tkrzw::SearchTextFileRegex (File *file, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool utf=false) |
Searches a text file and get lines which match a regular expression. More... | |
Status | tkrzw::SearchTextFileEditDistance (File *file, std::string_view pattern, std::vector< std::string > *matched, size_t capacity=0, bool utf=false) |
Searches a text file and get lines whose edit distance with a pattern is the least. More... | |
Common implementation components for database managers.