sdbf class
More...
#include <sdbf_class.h>
List of all members.
Public Member Functions |
| sdbf (FILE *in) |
| to read formatted sdbfs from open file pointer
|
| sdbf (const char *filename, uint32_t dd_block_size) |
| to create new from a single file
|
| sdbf (const char *name, std::istream *ifs, uint32_t dd_block_size, uint64_t msize, index_info *info) |
| to create by reading from an open stream
|
| sdbf (const char *name, char *str, uint32_t dd_block_size, uint64_t length, index_info *info) |
| to create from a c-string
|
| ~sdbf () |
| destructor
|
const char * | name () |
| object name
|
uint64_t | size () |
| object size
|
uint64_t | input_size () |
| source object size
|
int32_t | compare (sdbf *other, uint32_t sample) |
| matching algorithm, take other object and run match
|
string | to_string () const |
| return a string representation of this sdbf
|
string | get_index_results () const |
| return results of index search
|
uint8_t * | clone_filter (uint32_t position) |
| return a copy of an individual bloom filter from this sdbf
|
Static Public Attributes |
static class sdbf_conf * | config = new sdbf_conf(1, FLAG_OFF, _MAX_ELEM_COUNT, _MAX_ELEM_COUNT_DD) |
| global configuration object
|
Friends |
std::ostream & | operator<< (std::ostream &os, const sdbf &s) |
| output operator
|
std::ostream & | operator<< (std::ostream &os, const sdbf *s) |
| output operator
|
Detailed Description
sdbf: a Similarity Digest Bloom Filter class.
- Examples:
- sdbf_test.cc.
Constructor & Destructor Documentation
Reads an already generated sdbf from open file. Throws exceptions in case of bad formatting.
- Parameters:
-
in | FILE* open formatted as list of sdbfs |
sdbf::sdbf |
( |
const char * |
filename, |
|
|
uint32_t |
dd_block_size |
|
) |
| |
Create new sdbf from file. dd_block_size turns on "block" mode.
- Parameters:
-
filename | file to hash |
dd_block_size | size of block to process file with. 0 is off. |
sdbf::sdbf |
( |
const char * |
name, |
|
|
std::istream * |
ifs, |
|
|
uint32_t |
dd_block_size, |
|
|
uint64_t |
msize, |
|
|
index_info * |
info |
|
) |
| |
Generates a new sdbf, with a maximum size read from an open stream. dd_block_size enables block mode.
- Parameters:
-
name | name of stream |
ifs | open istream to read raw data from |
dd_block_size | size of block to divide data with. 0 is off. |
msize | amount of data to read and process |
info | block of information about indexes |
sdbf::sdbf |
( |
const char * |
name, |
|
|
char * |
str, |
|
|
uint32_t |
dd_block_size, |
|
|
uint64_t |
length, |
|
|
index_info * |
info |
|
) |
| |
Generates a new sdbf, from a char *string dd_block_size enables block mode.
- Parameters:
-
name | name of stream |
str | input to be hashed |
dd_block_size | size of block to divide data with. 0 is off. |
length | length of str to be hashed |
info | block of information about indexes |
Member Function Documentation
Clones a copy of a single bloom filter in this sdbf.
Warning: 256-bytes long, not terminated, may contain nulls.
- Parameters:
-
position | index of bloom filter |
- Returns:
- uint8_t* pointer to 256-byte long bloom filter
Compares this sdbf to other passed sdbf, returns a confidence score
- Parameters:
-
other | sdbf* to compare to self |
sample | sets the number of BFs to sample - 0 uses all |
- Returns:
- int32_t confidence score
- Examples:
- sdbf_test.cc.
Returns the size of the data that the hash was generated from.
- Returns:
- uint64_t length value
Returns the name of the file or data this sdbf represents.
- Returns:
- char* of file name
Returns the size of the hash data for this sdbf
- Returns:
- uint64_t length value
Encode this sdbf and return it as a string.
- Returns:
- std::string containing sdbf suitable for display or writing to file
The documentation for this class was generated from the following files: