2#ifndef __ASE_STORAGE_HH__
3#define __ASE_STORAGE_HH__
28 Error store_file_data (
const String &filename,
const String &buffer,
bool alwayscompress =
false);
29 Error store_file (
const String &filename,
const String &ondiskpath,
bool maycompress =
true);
31 Error remove_opened ();
43 bool has_file (
const String &filename);
52 virtual String name ()
const = 0;
53 virtual ssize_t read (
void *buffer,
size_t len) = 0;
54 virtual bool close () = 0;
58StreamReaderP stream_reader_from_file (
const String &file);
59StreamReaderP stream_reader_zip_member (
const String &archive,
const String &member, Storage::StorageFlags f = Storage::AUTO_ZSTD);
64 virtual String name ()
const = 0;
65 virtual ssize_t write (
const void *buffer,
size_t len) = 0;
66 virtual bool close () = 0;
70StreamWriterP stream_writer_create_file (
const String &filename,
int mode = 0644);
static constexpr size_t buffer_size
Recommended buffer size.
static constexpr size_t buffer_size
Recommended buffer size.
The Anklang C++ API namespace.
String anklang_cachedir_create()
Create exclusive cache directory for this process' runtime.
Error
Enum representing Error states.
void anklang_cachedir_clean_stale()
Clean stale cache directories from past runtimes, may be called from any thread.
void anklang_cachedir_cleanup(const String &cachedir)
Cleanup a cachedir previously created with anklang_cachedir_create().