esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
null.hpp
Go to the documentation of this file.
1#ifndef NDNPH_PORT_FS_NULL_HPP
2#define NDNPH_PORT_FS_NULL_HPP
3
4#include "../../core/common.hpp"
5
6namespace ndnph {
7namespace port_fs_null {
8
10class FileStore {
11public:
17 bool open() {
18 return false;
19 }
20
28 int read(const char* filename, uint8_t* buffer, size_t count) {
29 (void)filename;
30 (void)buffer;
31 (void)count;
32 return 0;
33 }
34
42 bool write(const char* filename, const uint8_t* buffer, size_t count) {
43 (void)filename;
44 (void)buffer;
45 (void)count;
46 return false;
47 }
48
54 bool unlink(const char* filename) {
55 (void)filename;
56 return true;
57 }
58};
59
60} // namespace port_fs_null
61
62#ifdef NDNPH_PORT_FS_NULL
63namespace port {
64using FileStore = port_fs_null::FileStore;
65} // namespace port
66#endif
67
68} // namespace ndnph
69
70#endif // NDNPH_PORT_FS_NULL_HPP
File storage stub.
Definition null.hpp:10
int read(const char *filename, uint8_t *buffer, size_t count)
Read a file.
Definition null.hpp:28
bool write(const char *filename, const uint8_t *buffer, size_t count)
Write a file.
Definition null.hpp:42
bool unlink(const char *filename)
Delete a file.
Definition null.hpp:54
bool open()
Open the storage.
Definition null.hpp:17
Definition fs.hpp:33