mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 15:29:37 -05:00
Add File::open_for_reading().
Barf.
This commit is contained in:
parent
38ba02a68f
commit
0a9d7ec8d8
@ -30,6 +30,11 @@ bool File::open_for_writing(const std::string& file_path) {
|
||||
return (open_result == FR_OK);
|
||||
}
|
||||
|
||||
bool File::open_for_reading(const std::string& file_path) {
|
||||
const auto open_result = f_open(&f, file_path.c_str(), FA_READ | FA_OPEN_EXISTING);
|
||||
return (open_result == FR_OK);
|
||||
}
|
||||
|
||||
bool File::open_for_append(const std::string& file_path) {
|
||||
if( open_for_writing(file_path) ) {
|
||||
const auto seek_result = f_lseek(&f, f_size(&f));
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
~File();
|
||||
|
||||
bool open_for_writing(const std::string& file_path);
|
||||
bool open_for_reading(const std::string& file_path);
|
||||
bool open_for_append(const std::string& file_path);
|
||||
bool close();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user