acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
directory_context.h
1#pragma once
2
3
5#include "acme/filesystem/filesystem/enumerator.h"
6//#include "acme/filesystem/filesystem/path.h"
7
8
9//namespace file
10//{
11
12
13 class CLASS_DECL_ACME directory_context :
14 virtual public ::object,
15 virtual public ::file::enumerator
16 {
17 public:
18
19
20 ::file::path m_pathLocalFolder;
21
22
23 directory_context();
24 ~directory_context() override;
25
26
27 virtual void initialize(::particle * pparticle) override;
28
29
30 virtual void init_system();
31 virtual void init_context();
32
33 virtual void term_system();
34 virtual void term_context();
35
36 void destroy() override;
37
38 //::file::watcher & watcher();
39
40
41 //bool _enumerates(::file::listing_base & listing) override;
42 bool enumerate(::file::listing_base & listing) override;
43 virtual bool _enumerate(::file::listing_base & listing);
44
45
46 //virtual bool list_relative_name(::file::listing_base & listing);
47
48 //virtual bool list_recursively(::file::listing_base& listing);
49 //virtual bool list_recursively_relative_name(::file::listing_base& listing);
50
51 //virtual bool list_pattern(::file::listing_base& listing, const ::file::path& path, const string_array_base& straPattern);
52 //virtual bool list_file_pattern(::file::listing_base& listing, const ::file::path& path, const string_array_base& straPattern);
53 //virtual bool list_recursively_pattern(::file::listing_base& listing, const ::file::path& path, const string_array_base & straPattern);
54 //virtual bool list_recursively_file_pattern(::file::listing_base& listing, const ::file::path& path, const string_array_base & straPattern);
55
56 //virtual bool list_file(::file::listing_base& listing);
57 //virtual bool list_directory(::file::listing_base& listing);
58
59 //virtual bool list_recursively_file(::file::listing_base& listing);
60 //virtual bool list_recursively_directory(::file::listing_base& listing);
61
62 //inline bool enumerate(::file::listing_base& listing, const ::file::path& path) { listing(path); return ls(listing); }
63
64 //inline bool list_recursively(::file::listing_base& listing, const ::file::path& path) { listing(path); return list_recursively(listing); }
65
66 //inline bool list_file(::file::listing_base& listing, const ::file::path & path) { listing(path); return ls_file(listing); }
67 //inline bool list_directory(::file::listing_base& listing, const ::file::path& path) { listing(path); return ls_dir(listing); }
68
69 //inline bool list_recursively_file(::file::listing_base& listing, const ::file::path& path) { listing(path); return list_recursively_file(listing); }
70 //inline bool list_recursively_directory(::file::listing_base& listing, const ::file::path& path) { listing(path); return list_recursively_dir(listing); }
71
72
73 inline ::i32_boolean is(const ::payload & payload) { return file_type(payload) & ::file::e_type_folder2; }
74
75 //virtual bool _is(const ::file::path& pcsz);
76
77 //virtual bool __is(const ::file::path & path, bool & bIsDir);
78
79 virtual ::file::e_type file_type(const ::payload & payload);
80
81 virtual ::file::e_type _file_type(const ::file::path& path);
82
83 virtual ::file::e_type __file_type(const ::file::path& path);
84
85
86 //virtual bool is_cached(bool & bIs, const ::file::path & path);
87
88
89 virtual ::file::e_type cached_file_type(const ::file::path& path);
90
91
92 virtual bool name_is(const ::file::path & path);
93
94
95 virtual bool is_inside(const ::file::path & pathFolder, const ::file::path & lpcszPath);
96
97 virtual bool is_inside_time(const ::file::path & path);
98
99 virtual ::file::listing_base & root_ones(::file::listing_base & listing);
100 virtual void create(const ::file::path & path);
101
102 virtual void erase(const ::file::path & path, bool bRecursive = true);
103
104 virtual bool has_subdir(const ::file::path & path);
105
106 virtual bool fast_has_subdir(const ::file::path & path);
107
108
109 virtual ::file::path defer_get_file_system_file(const ::file::path & path, bool bExpandAll);
110
111
112 virtual ::file::path time();
113 virtual ::file::path stage();
114 virtual ::file::path stageapp();
115 virtual ::file::path netseed();
116
117 virtual ::file::path install();
118 virtual ::file::path config();
119
120 virtual ::file::path home();
121
122 virtual ::file::path module();
123 //virtual ::file::path ca2module();
124 virtual ::file::path time_square();
125 virtual ::file::path time_log(const ::scoped_string & scopedstrId);
126
127
128 virtual void get_matter_locator(string_array_base & straMatterLocator, bool bIncludeMain = true);
129
130
131 virtual ::file::path locale_schema_matter(const ::scoped_string & scopedstrLocale, const ::scoped_string & scopedstrSchema, const ::file::path & pathRoot, const ::file::path & pathDomain);
132 virtual ::file::path matter(const ::file::path & path, const ::file::path & pathRoot, const ::file::path & pathDomain);
133
134 virtual ::file::path matter(const ::file::path_array_base & patha);
135 virtual ::file::path matter(::file::path path);
136
137 virtual ::file::path appmatter(::file::path path);
138
139 virtual ::file::path matter_from_locator(const ::file::path_array_base & patha, const string_array_base & straMatterLocator);
140 virtual ::file::path matter_from_locator(::file::path path, const string_array_base & straMatterLocator);
141
142 virtual ::file::path appmatter(const ::scoped_string & scopedstrApp, ::file::path pathRel);
143
144 virtual bool matter_enumerate(const ::file::path & str, ::file::listing_base & listing, ::file::e_flag eflag = ::file::e_flag_none, enum_depth edepth = e_depth_none);
145 //virtual bool matter_ls_file(const ::file::path & str, ::file::listing_base& stra);
146
147 //virtual ::file::path commonappdata(const ::scoped_string & scopedstrAppId, const ::scoped_string & scopedstrBuild = nullptr, const ::scoped_string & scopedstrPlatform = nullptr, const ::scoped_string & scopedstrConfiguration = nullptr);
148 //virtual ::file::path commonappdata_locale_schema(const ::scoped_string & scopedstrAppId, const ::scoped_string & scopedstrBuild = nullptr, const ::scoped_string & scopedstrPlatform = nullptr, const ::scoped_string & scopedstrConfiguration = nullptr, const ::scoped_string & scopedstrLocale = nullptr, const ::scoped_string & scopedstrSchema = nullptr);
149
150 virtual ::file::path trash_that_is_not_trash(const ::file::path & path);
151
152 virtual ::file::path cache();
153 virtual ::file::path appdata(const ::scoped_string & scopedstrAppId = "");
154 virtual ::file::path commonappdata_root();
155 virtual ::file::path commonappdata();
156 virtual ::file::path element_commonappdata(const ::scoped_string & scopedstrElement);
157
158 virtual ::file::path localfolder();
159
160 virtual ::file::path userquicklaunch();
161 virtual ::file::path userprograms();
162
163 virtual ::file::path commonprograms();
164
165 virtual ::file::path pathfind(const ::scoped_string & scopedstrEnv, const ::scoped_string & scopedstrTopic, const ::scoped_string & scopedstrMode);
166
167 //virtual void initialize(::particle * pparticle) override;
168
169 //virtual ::file::path get_api_cc();
170
171 virtual ::file::path bookmark();
172
173 virtual ::file::path desktop();
174 virtual ::file::path document();
175 virtual ::file::path document2();
176 virtual ::file::path download();
177
178 virtual ::file::path music();
179 virtual ::file::path video();
180 virtual ::file::path image();
181
182 //virtual ::file::path dropbox();
183 virtual ::file::path onedrive();
184
185 //virtual ::file::path dropbox_app();
186
187 //virtual bool is_dropbox_installed();
188 //virtual void calculate_dropbox_installed();
189 //virtual bool is_onedrive_installed();
190 //virtual void calculate_onedrive_installed();
191
192 virtual ::file::path standalone();
193
194 //virtual string_array_base locale_schema_matter(string & strLocale, const ::scoped_string & scopedstrStyle);
195 //virtual string_array_base locale_schema_matter(string & strLocale, const ::scoped_string & scopedstrStyle, const string & pathRoot, const ::file::path & pathDomain);
196 //virtual string matter(const ::file::path_array_base & patha, bool bDir);
197 //virtual string matter(const ::file::path & path, bool bDir );
198
199 //virtual void matter_ls(const ::file::path & str, ::file::path_array_base & stra);
200 //virtual ::file::path matter_file(const ::file::path & path, bool bDir = false);
201 //virtual void matter_ls_file(const ::file::path & str, ::file::path_array_base & stra);
202
203 //virtual ::file::path usersystemappdata(const ::scoped_string & scopedstrPrefix);
204
205 //virtual ::file::path userappdata();
206 //virtual ::file::path userdata();
207 //virtual ::file::path userfolder();
208 //virtual ::file::path default_os_user_path_prefix();
209 //virtual ::file::path default_userappdata(const ::scoped_string & scopedstrPrefix, const ::scoped_string & scopedstrLogin );
210
211 //virtual ::file::path default_userdata(const ::scoped_string & scopedstrPrefix, const ::scoped_string & scopedstrLogin);
212
213 //virtual ::file::path default_userfolder(const ::scoped_string & scopedstrPrefix, const ::scoped_string & scopedstrLogin);
214
215
216
217 //virtual ::file::path userquicklaunch();
218 //virtual ::file::path userprograms();
219
220
221 //virtual ::file::listing_base & ls(::file::listing_base & listing);
222 //virtual ::file::listing_base & ls_relative_name(::file::listing_base & listing);
223
224
225 //virtual bool has_subdir(const ::file::path & path);
226
227 //virtual bool is(const ::file::path & path);
228
229 //virtual bool is(const ::scoped_string & scopedstr);
230 //virtual bool is(const ::payload & payload);
231 //virtual bool is_inside(const ::file::path & pathFolder, const ::file::path & lpcszPath);
232
233 //virtual bool is_inside_time(const ::file::path & path);
234
235 //virtual ::file::listing_base & root_ones(::file::listing_base & listing);
236 //virtual bool mk(const ::file::path & path);
237
238 //virtual bool rm(const ::file::path & path, bool bRecursive = true);
239
240 //virtual ::file::path pathfind(const ::scoped_string & scopedstrEnv, const ::scoped_string & scopedstrTopic, const ::scoped_string & scopedstrMode);
241
242 //virtual ::file::path dropbox();
243
244
245 //virtual ::file::path onedrive();
246
247 //virtual ::file::path dropbox_client();
248
249
250
251 };
252
253
254 typedef ::pointer<directory_context>dir_context_pointer;
255
256
257//} // namespace file
258
259
260
Definition enumerator.h:14
Definition listing.h:33
Definition path.h:52
virtual void destroy() override
Definition bbb_context_object.cpp:242