A class for writing large lists of strings to disk with an associated index file for fast random access.
More...
#include <string_list_writer.h>
|
using | ofstream = std::unique_ptr< std::ofstream > |
| workaround for lack of move operators for gcc 4.8
|
|
A class for writing large lists of strings to disk with an associated index file for fast random access.
This class is used for writing the output format read by the string_list class.
meta::index::string_list_writer::string_list_writer |
( |
const std::string & |
path, |
|
|
uint64_t |
size |
|
) |
| |
Constructs the writer, writing the string file to the given path.
The index file will go alongside that path.
- Parameters
-
path | The path to write the string file to. |
size | The number of strings in the list (must be known) |
void meta::index::string_list_writer::insert |
( |
uint64_t |
idx, |
|
|
const std::string & |
elem |
|
) |
| |
Sets the string at idx to be elem.
- Parameters
-
std::ofstream& meta::index::string_list_writer::file |
( |
| ) |
|
|
inlineprivate |
- Returns
- a reference to the file stream
ofstream meta::index::string_list_writer::make_file |
( |
const std::string & |
path | ) |
|
|
inlineprivate |
- Parameters
-
- Returns
- a std::ofstream created from the file
The documentation for this class was generated from the following files: