MADARA
3.4.1
|
Splits files into fragments that can be saved to and loaded from a knowledge base. More...
#include <FileStreamer.h>
Public Member Functions | |
FileStreamer () | |
Constructor. More... | |
FileStreamer (const std::string &key, const std::string &filename, KnowledgeBase kb) | |
Constructor. More... | |
void | clear_fragments (void) |
Clears the fragment list. More... | |
uint32_t | get_crc (void) |
Returns the crc of the file. More... | |
std::string | get_filename (void) |
Returns the name of the file. More... | |
size_t | get_size (void) |
Returns the size of the file. More... | |
void | init (const std::string &key, const std::string &filename, KnowledgeBase kb) |
Initializes the file stream and all containers. More... | |
size_t | load (size_t index, size_t frag_size=60000) |
Loads a fragment into the knowledge base. More... | |
void | modify (void) |
Remodifies the file size and crc. More... | |
Public Attributes | |
containers::Integer | file_crc |
the crc of the file More... | |
containers::Map | file_fragments |
the crc of the file More... | |
containers::Integer | file_size |
the size of the file contents More... | |
containers::FlexMap | file_space |
records that contain the file fragments More... | |
Private Attributes | |
std::string | filename_ |
the name of the file More... | |
std::ifstream | stream_ |
the stream to read from More... | |
Splits files into fragments that can be saved to and loaded from a knowledge base.
Definition at line 23 of file FileStreamer.h.
|
inline |
Constructor.
Definition at line 29 of file FileStreamer.h.
|
inline |
Constructor.
key | the location in the knowledge base to save to |
filename | the file to open and read from |
kb | the knowledge base to stream to |
Definition at line 37 of file FileStreamer.h.
|
inline |
Clears the fragment list.
Definition at line 130 of file FileStreamer.h.
|
inline |
Returns the crc of the file.
Definition at line 104 of file FileStreamer.h.
|
inline |
Returns the name of the file.
Definition at line 122 of file FileStreamer.h.
|
inline |
Returns the size of the file.
Definition at line 113 of file FileStreamer.h.
|
inline |
Initializes the file stream and all containers.
key | the location in the knowledge base to save to |
filename | the file to open and read from |
kb | the knowledge base to stream to |
Definition at line 49 of file FileStreamer.h.
|
inline |
Loads a fragment into the knowledge base.
Definition at line 73 of file FileStreamer.h.
|
inline |
Remodifies the file size and crc.
Definition at line 138 of file FileStreamer.h.
containers::Integer madara::knowledge::FileStreamer::file_crc |
the crc of the file
Definition at line 151 of file FileStreamer.h.
containers::Map madara::knowledge::FileStreamer::file_fragments |
the crc of the file
Definition at line 154 of file FileStreamer.h.
containers::Integer madara::knowledge::FileStreamer::file_size |
the size of the file contents
Definition at line 148 of file FileStreamer.h.
containers::FlexMap madara::knowledge::FileStreamer::file_space |
records that contain the file fragments
Definition at line 145 of file FileStreamer.h.
|
private |
the name of the file
Definition at line 158 of file FileStreamer.h.
|
private |
the stream to read from
Definition at line 161 of file FileStreamer.h.