mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-02 21:52:13 -04:00
Add File::open_for_reading().
Barf.
This commit is contained in:
parent
38ba02a68f
commit
0a9d7ec8d8
2 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue