ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Attributes | List of all members
meta::index::string_list Class Reference

A class designed for reading large lists of strings that have been persisted to disk. More...

#include <string_list.h>

Public Member Functions

 string_list (const std::string &path)
 Constructs the string list. More...
 
 string_list (string_list &&)=default
 Move constructs a string list.
 
string_listoperator= (string_list &&)=default
 Move assigns a string list.
 
const char * at (uint64_t idx) const
 
uint64_t size () const
 

Private Attributes

io::mmap_file string_file_
 The file containing the strings.
 
util::disk_vector< uint64_t > index_
 An index that gives the starting byte for each index.
 

Detailed Description

A class designed for reading large lists of strings that have been persisted to disk.

This class provides read-only access—string_list_writer provides write-only access and is to be used for building the string list and associated index this class reads.

Constructor & Destructor Documentation

meta::index::string_list::string_list ( const std::string &  path)

Constructs the string list.

Parameters
pathThe path to where this object is stored

Member Function Documentation

const char * meta::index::string_list::at ( uint64_t  idx) const
Parameters
idx
Returns
the string at a given index.
uint64_t meta::index::string_list::size ( ) const
Returns
the number of strings in the list.

The documentation for this class was generated from the following files: