move save and load buffer to file in to buffer class
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
class Buffer
|
||||
{
|
||||
@@ -7,6 +8,7 @@ public:
|
||||
uint8_t* buffer = nullptr;
|
||||
size_t taken = 0;
|
||||
size_t size = 0;
|
||||
std::string file_path;
|
||||
|
||||
Buffer(size_t size);
|
||||
Buffer();
|
||||
@@ -26,4 +28,10 @@ public:
|
||||
|
||||
void clear() { taken = 0; }
|
||||
|
||||
bool save_to_file();
|
||||
bool save_to_file(std::string file_path);
|
||||
|
||||
bool load_from_file();
|
||||
bool load_from_file(std::string file_path);
|
||||
|
||||
};
|
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
class Buffer;
|
||||
|
||||
@@ -31,7 +31,3 @@ LoginInfoPointer get_logininfo_pointer_from_buffer(Buffer& buffer, int index_of_
|
||||
|
||||
void generate_password(std::string& password, int len);
|
||||
|
||||
bool save_buffer_to_file(Buffer& buffer);
|
||||
|
||||
bool load_buffer_from_file(Buffer& buffer);
|
||||
|
||||
|
Reference in New Issue
Block a user