5#include "acme/platform/department.h"
6#include "acme/filesystem/filesystem/file_system_interface.h"
18 ::file::path m_pathModule;
19 ::string_array m_straFileSystemItemSlot;
20 critical_section m_criticalsectionaFileSystemItemSlot[MAX_FILE_SYSTEM_ITEM_SLOT_COUNT];
23 ::IDENTIFIER_SUFFIX_OPERATING_SYSTEM(acme_)::file_system * m_pplatformfile;
24 ::directory_system * m_pdirectorysystem;
25 ::path_system * m_ppathsystem;
27 ::file::path m_pathExecutable;
29 ::pointer < ::mutex > m_pmutexFileSystemItem;
30 string_map_base < ::pointer < ::file_system_item > > m_mapFileSystemItem;
34 ~file_system()
override;
37 virtual void initialize(::particle* pparticle)
override;
39 virtual void init_system();
41 virtual ::i32 file_system_item_slot_index(const ::scoped_string& scopedstrSlotName);
44 virtual void ensure_exists(const ::file::path & path);
45 virtual void touch(const ::file::path & path);
46 virtual void touch_app_cloud(const ::file::path & path, const_char_pointer pszContentIdentifier =
nullptr);
47 virtual void clear_read_only(const ::file::path & path);
50 virtual void set_file_normal(const ::file::path & path);
53 virtual bool is_equal(const ::file::path & path1, const ::file::path & path2);
54 virtual void overwrite_if_different(const ::file::path & pathTarget, const ::file::path & pathSource);
60 virtual ::file::path module();
63 file_pointer get_file(const ::payload& payloadFile, ::file::e_open eopen, ::pointer < ::file::exception >* pfileexception =
nullptr)
override;
65 virtual file_pointer get_reader(const ::payload& payloadFile, ::file::e_open eopen = ::file::e_open_read | ::file::e_open_binary, ::pointer < ::file::exception >* pfileexception =
nullptr);
67 virtual file_pointer get_writer(const ::payload& payloadFile, ::file::e_open eopen = ::file::e_open_read_write | ::file::e_open_binary | ::file::e_open_defer_create_directory, ::pointer < ::file::exception >* pfileexception =
nullptr);
70 virtual void append_wait(const ::file::path & pathFile,
const block & block,
const class time & time);
71 virtual void append(const ::file::path & pathFile,
const block & block);
72 virtual ::filesize size(const ::file::path & pathFile);
73 virtual ::memory slice(const ::file::path & pathFile, memsize start, memsize count);
74 virtual ::memory beginning(const ::file::path & pathFile, memsize len);
75 virtual ::memory ending(const ::file::path & pathFile, memsize len);
76 virtual bool append_unique_line(const ::file::path & pathFile, const ::scoped_string & scopedstrLine);
77 virtual ::collection::count find_and_erase(const ::file::path & pathFile,
const block & block);
79 virtual bool exists(const ::file::path & path);
80 virtual bool __exists(const ::file::path& path);
83 virtual filesize get_size(const ::file::path & path);
84 virtual filesize get_size_fd(::i32 iFile);
87 virtual void clear_application_data();
90 virtual void find_replace(const ::file::path & path, const ::property_set & set);
93 virtual void put_app_cloud_data(const ::file::path & path, const_char_pointer pszContentIdentifier, const ::block & block);
95 virtual ::memory get_app_cloud_data(const ::file::path & path, const_char_pointer pszContentIdentifier);
97 virtual void put_documents_cloud_data(const ::file::path & path, const ::block & block);
99 virtual ::memory get_documents_cloud_data(const ::file::path & path);
126 virtual bool is_true(const ::file::path & path);
129 virtual void set_size(const ::file::path & pathName, filesize iSize);
130 virtual void set_size(::i32 iFileDescriptor, filesize iSize);
133 virtual void transfer(const ::file::path & pathNewName, const ::file::path & pathOldName);
135 virtual void erase(const ::file::path & path);
136 virtual void defer_erase(const ::file::path& path);
137 virtual bool safe_erase(const ::file::path& path);
141 virtual void copy(const ::file::path & pathDup, const ::file::path & pathSrc,
bool bOverwrite);
142 virtual void _copy(const ::file::path & pathDup, const ::file::path & pathSrc,
bool bOverwrite);
145 virtual bool text_is_different(const ::file::path & path1, const ::file::path & path2, ::string * pstr1 =
nullptr, ::string * pstr2 =
nullptr);
146 virtual bool copy_if_text_is_different(const ::file::path & pathTarget, const ::file::path & pathSource, const ::procedure & procedureRunIfFilesAreDifferentAndAfterCopy = {});
149 virtual bool _memory_map_file_copy(const ::file::path & pathNew, const ::file::path & pathSrc);
151 virtual void _read_write_file_copy(const ::file::path & pathNew, const ::file::path & pathSrc, ::memsize buffer_size = 1_MiB);
154 virtual class ::time modification_time(const ::file::path & path);
155 virtual void set_modification_time(const ::file::path & path,
const class ::time & time);
156 virtual void synchronize(const ::file::path & path1, const ::file::path & path2);
159 virtual void save_stra(const ::file::path & pathName,
const string_array_base & stra);
160 virtual void load_stra(const ::file::path & pathName, string_array_base & stra,
bool bAddEmpty =
true);
163 virtual void put_contents(const ::file::path & path,
const block & block);
166 template <
typename CONTAINER >
167 inline void put_lines(const ::file::path & path,
const CONTAINER & container)
172 for (
auto & line : container)
177#ifdef WINDOWS_DESKTOP
189 put_block(path, str);
193 virtual void as_memory(memory_base & memory, const ::file::path & path, memsize iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
195 virtual memory as_memory(const ::file::path & path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
196 virtual memsize as_memory(const ::file::path & path,
void * p, memsize s);
197 virtual memory safe_get_memory(
const file::path & path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
198 virtual memory __safe_get_memory(
const file::path& path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
199 virtual memsize __safe_find_string(const ::file::path& path, const_char_pointer psz);
200 virtual string as_string(const ::file::path & path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
201 virtual string safe_get_string(const ::file::path & path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
202 virtual string __safe_get_string(const ::file::path& path, character_count iReadAtMostByteCount = -1,
bool bNoExceptionOnOpen =
true);
205 virtual void put_block(const ::file::path & path,
const block & block);
207 virtual void put_now(const ::file::path& path);
208 virtual void put_time(const ::file::path& path, const ::earth::time & time);
209 virtual ::earth::time as_time(const ::file::path& path);
210 virtual ::earth::time safe_time(const ::file::path& path);
213 virtual void as_block(block & block, const ::file::path & path);
221 virtual string first_line(const ::file::path & path);
222 virtual string line(const ::file::path & path, ::collection::index iLine);
223 virtual string_array_base lines(const ::file::path & path);
224 virtual void set_line(const ::file::path & path, ::collection::index iLine, const ::scoped_string & scopedstrLine);
226 virtual string get_temporary_file_name(const ::scoped_string & scopedstrName, const ::scoped_string & scopedstrExtension);
228 virtual void get_temporary_file_name_template(char_pointer szRet, character_count iBufferSize,
const scoped_string & scopedstrName, const ::scoped_string & scopedstrExtension, const ::scoped_string & scopedstrTemplate);
235 virtual void append(const ::scoped_string & scopedstrFile,
const block & block);
236 virtual void append_wait(const ::scoped_string & scopedstrFile,
const block & block,
const class time & timeWait = ::time::infinity());
242 virtual bool _exists(const ::file::path & path);
243 virtual void _erase(const ::file::path & path);
247 virtual ::file::path time_put_contents(const ::file::path& pathFolder, const ::scoped_string & scopedstrPrefix, const ::scoped_string & scopedstrExtension, const ::scoped_string & scopedstr);
263 bool _file_system_has_script(const ::file_system_cache_item & pfilesystemcacheitem)
override;
264 ::string _file_system_expanded_md5(const ::file_system_cache_item & pfilesystemcacheitem)
override;
267 ::file_system_cache_item file_system_item(const ::scoped_string& scopedstrName, ::file_system_real_path_interface* pfilesystemrealpathinterface)
override;
269 ::file_system_item * get_file_system_item(const ::scoped_string& scopedstrName, ::file_system_real_path_interface * pfilesystemrealpathinterface)
override;
Definition file_system_interface.h:15
Definition aaa_file_system.h:10