mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 05:17:39 +00:00
Implement std::filesystem::space().
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "ff.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -75,8 +76,17 @@ std::string next_filename_stem_matching_pattern(const std::string& filename_stem
|
||||
namespace std {
|
||||
namespace filesystem {
|
||||
|
||||
using path = std::string;
|
||||
using file_status = BYTE;
|
||||
|
||||
struct space_info {
|
||||
static_assert(sizeof(std::uintmax_t) >= 8, "std::uintmax_t too small (<uint64_t)");
|
||||
|
||||
std::uintmax_t capacity;
|
||||
std::uintmax_t free;
|
||||
std::uintmax_t available;
|
||||
};
|
||||
|
||||
struct directory_entry : public FILINFO {
|
||||
file_status status() const {
|
||||
return fattrib;
|
||||
@@ -126,6 +136,8 @@ inline bool operator!=(const directory_iterator& lhs, const directory_iterator&
|
||||
|
||||
bool is_regular_file(const file_status s);
|
||||
|
||||
space_info space(const path& p);
|
||||
|
||||
} /* namespace filesystem */
|
||||
} /* namespace std */
|
||||
|
||||
|
Reference in New Issue
Block a user