Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
StorageManager.h File Reference

Abstract interface for file and directory storage backends. More...

#include <string>
#include <vector>
#include <functional>
#include <cstdint>
#include <nlohmann/json.hpp>
#include "storage/StorageFileReader.h"
+ Include dependency graph for StorageManager.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FileInfo
 Structure representing metadata for a file or directory. More...
 
class  StorageManager
 Abstract base class for storage access and file operations. More...
 

Functions

void to_json (nlohmann::json &j, const FileInfo &f)
 

Detailed Description

Author
Ian Archbell

Part of the PicoFramework application framework. Defines a virtual base class for file storage operations including read/write, file streaming, directory listing, and size queries.

Version
0.1
Date
2025-03-31
License:\n MIT License

Definition in file StorageManager.h.

Function Documentation

◆ to_json()

void to_json ( nlohmann::json j,
const FileInfo f 
)
inline

Definition at line 36 of file StorageManager.h.

36 {
37 j = nlohmann::json{
38 {"name", f.name},
39 {"size", f.size},
40 {"isDir", f.isDirectory}
41 };
42}
bool isDirectory
True if item is a directory.
size_t size
Size in bytes.
std::string name
File or directory name.

References FileInfo::isDirectory, FileInfo::name, and FileInfo::size.