|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
An IFileStore in memory: bounded per file and per principal; an upload that stalls expires. More...
#include <file_store.hpp>
Public Member Functions | |
| MemoryFileStore (MemoryFileStoreOptions options={}) | |
A store with options. | |
| std::expected< std::string, FileError > | begin (std::string const &principal, FileInfo info) override |
| Starts an upload. | |
| std::expected< std::size_t, FileError > | append (std::string const &principal, std::string const &upload, std::size_t offset, std::string_view bytes) override |
| Appends a chunk. | |
| std::expected< std::string, FileError > | finish (std::string const &principal, std::string const &upload) override |
| Ends an upload and files it. | |
| std::expected< std::string, FileError > | issue (std::string const &principal, FileInfo info, std::string bytes) override |
| Files bytes for a principal. | |
| std::expected< FileSlice, FileError > | read (std::string const &principal, std::string const &ref, std::size_t offset, std::size_t length) override |
| Reads a slice. | |
| Public Member Functions inherited from morph::ui::IFileStore | |
| IFileStore (IFileStore const &)=delete | |
| IFileStore & | operator= (IFileStore const &)=delete |
| IFileStore (IFileStore &&)=delete | |
| IFileStore & | operator= (IFileStore &&)=delete |
An IFileStore in memory: bounded per file and per principal; an upload that stalls expires.
Thread-safe: the UI service calls it on the server strand while an application issues references from its models'.
Definition at line 164 of file file_store.hpp.
|
inlineexplicit |
A store with options.
| options | The bounds and the clock. |
Definition at line 168 of file file_store.hpp.
|
inlinenodiscardoverridevirtual |
Starts an upload.
| principal | The uploader. |
| info | The file's name, type and size. |
Implements morph::ui::IFileStore.
Definition at line 174 of file file_store.hpp.
|
inlinenodiscardoverridevirtual |
Appends a chunk.
| principal | The uploader. |
| upload | The upload id. |
| offset | The bytes received so far. |
| bytes | The chunk. |
Implements morph::ui::IFileStore.
Definition at line 195 of file file_store.hpp.
|
inlinenodiscardoverridevirtual |
Ends an upload and files it.
| principal | The uploader. |
| upload | The upload id. |
Implements morph::ui::IFileStore.
Definition at line 219 of file file_store.hpp.
|
inlinenodiscardoverridevirtual |
Files bytes for a principal.
| principal | The principal. |
| info | The name and type. |
| bytes | The file. |
Implements morph::ui::IFileStore.
Definition at line 244 of file file_store.hpp.
|
inlinenodiscardoverridevirtual |
Reads a slice.
| principal | The reader. |
| ref | The reference. |
| offset | The first byte. |
| length | At most this many bytes. |
Implements morph::ui::IFileStore.
Definition at line 266 of file file_store.hpp.