mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-14 01:15:38 -04:00
Implement std::filesystem::space().
This commit is contained in:
parent
c48a88539a
commit
f157c13442
2 changed files with 30 additions and 0 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue