Editor API
UnigineEditor public API
UnigineAssetManager.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 // DO NOT EDIT DIRECTLY. This is an auto-generated file. Your changes will be lost.
3 
4 #pragma once
5 
6 #include <UnigineCallback.h>
7 #include <UnigineGUID.h>
8 #include <UniginePtr.h>
9 
10 #include "UnigineEditorGlobal.h"
11 #include "UnigineCollection.h"
12 
13 namespace UnigineEditor
14 {
15 
16 class MountPointParameters;
18 // AssetManager.
26 class UNIGINE_EDITOR_API AssetManager
27 {
28 protected:
29 
30 
31 public:
34  static int isInitialized();
35  // assets
38  static Unigine::UGUID getAssetGUIDFromPath(const char *asset_path);
41  static Unigine::String getAssetPathFromGUID(const Unigine::UGUID &asset_guid);
46  static bool importAssetSync(const char *asset_path, const Unigine::Ptr<Collection> &import_parameters = {});
51  static bool importAssetAsync(const char *asset_path, const Unigine::Ptr<Collection> &import_parameters = {});
56  static bool reimportAssetSync(const char *asset_path, const Unigine::Ptr<Collection> &import_parameters = {});
61  static bool reimportAssetAsync(const char *asset_path, const Unigine::Ptr<Collection> &import_parameters = {});
65  static bool removeAssetSync(const char *asset_path);
69  static bool removeAssetAsync(const char *asset_path);
74  static bool moveAssetSync(const char *old_asset_path, const char *new_asset_path);
79  static bool moveAssetAsync(const char *old_asset_path, const char *new_asset_path);
84  static bool renameAssetSync(const char *asset_path, const char *new_asset_name);
89  static bool renameAssetAsync(const char *asset_path, const char *new_asset_name);
94  static bool copyAssetSync(const char *asset_path, const char *new_asset_path);
99  static bool copyAssetAsync(const char *asset_path, const char *new_asset_path);
102  static bool isAsset(const char *asset_path);
106  static Unigine::Ptr<Collection> getAssetImportParameters(const char *asset_path);
109  static bool isAssetWritable(const char *asset_path);
111  static Unigine::Vector<Unigine::UGUID> getAssetGUIDs();
113  static Unigine::Vector<Unigine::String> getAssetPaths();
116  static Unigine::Vector<Unigine::UGUID> getAssetGUIDsForDirectory(const char *directory_path);
119  static Unigine::Vector<Unigine::String> getAssetPathsForDirectory(const char *directory_path);
122  static Unigine::Vector<Unigine::UGUID> getRuntimeGUIDs(const char *asset_path);
125  static Unigine::String getRuntimeAlias(const Unigine::UGUID &runtime_guid);
128  static bool isRuntimePrimary(const Unigine::UGUID &runtime_guid);
129  // directories
133  static bool createDirectory(const char *directory_path);
137  static bool removeDirectorySync(const char *directory_path);
141  static bool removeDirectoryAsync(const char *directory_path);
146  static bool moveDirectorySync(const char *old_directory_path, const char *new_directory_path);
151  static bool moveDirectoryAsync(const char *old_directory_path, const char *new_directory_path);
156  static bool renameDirectorySync(const char *directory_path, const char *new_directory_name);
161  static bool renameDirectoryAsync(const char *directory_path, const char *new_directory_name);
166  static bool copyDirectorySync(const char *directory_path, const char *new_directory_path);
171  static bool copyDirectoryAsync(const char *directory_path, const char *new_directory_path);
174  static bool isDirectory(const char *directory_path);
177  static bool isDirectoryWritable(const char *directory_path);
179  static Unigine::Vector<Unigine::String> getDirectoryPathsAll();
182  static Unigine::Vector<Unigine::String> getDirectoryPaths(const char *directory_path);
183  // mount points
188  static bool createMountPoint(const char *directory_path, const Unigine::Ptr<MountPointParameters> &mount_creation_parameters);
192  static bool removeMountPoint(const char *directory_path);
195  static bool isMountPoint(const char *directory_path);
199  static Unigine::Ptr<MountPointParameters> getMountPointParameters(const char *directory_path);
203  static bool refreshMountPointAsync(const char *directory_path);
204  // file system watcher
213  static void blockAutoRefresh();
222  static void unblockAutoRefresh();
231  static bool isAutoRefreshBlocked();
232  // asset callbacks
238  static void *addAssetAddedCallback(Unigine::CallbackBase1<const char *> *func);
242  static bool removeAssetAddedCallback(void *id);
248  static void *addAssetBeforeRemoveCallback(Unigine::CallbackBase1<const char *> *func);
252  static bool removeAssetBeforeRemoveCallback(void *id);
258  static void *addAssetRemovedCallback(Unigine::CallbackBase1<const char *> *func);
262  static bool removeAssetRemovedCallback(void *id);
268  static void *addAssetChangedCallback(Unigine::CallbackBase1<const char *> *func);
272  static bool removeAssetChangedCallback(void *id);
278  static void *addAssetMovedCallback(Unigine::CallbackBase2<const char *, const char *> *func);
282  static bool removeAssetMovedCallback(void *id);
283  // directory callbacks
289  static void *addDirectoryAddedCallback(Unigine::CallbackBase1<const char *> *func);
293  static bool removeDirectoryAddedCallback(void *id);
299  static void *addDirectoryBeforeRemoveCallback(Unigine::CallbackBase1<const char *> *func);
303  static bool removeDirectoryBeforeRemoveCallback(void *id);
309  static void *addDirectoryRemovedCallback(Unigine::CallbackBase1<const char *> *func);
313  static bool removeDirectoryRemovedCallback(void *id);
319  static void *addDirectoryMovedCallback(Unigine::CallbackBase2<const char *, const char *> *func);
323  static bool removeDirectoryMovedCallback(void *id);
324  // process callbacks
330  static void *addProcessBeginCallback(Unigine::CallbackBase *func);
334  static bool removeProcessBeginCallback(void *id);
340  static void *addProcessEndCallback(Unigine::CallbackBase *func);
344  static bool removeProcessEndCallback(void *id);
345  // utils
354  static Unigine::String generateUniquePath(const char *path);
357  static bool isExist(const char *path);
358 };
359 
361 // MountPointParameters.
369 class UNIGINE_EDITOR_API MountPointParameters : public Unigine::APIInterface
370 {
371 public:
373  enum ACCESS
374  {
376  ACCESS_READONLY = 0,
379  };
381  static Unigine::Ptr<MountPointParameters> create();
384  void setAccess(MountPointParameters::ACCESS access);
386  MountPointParameters::ACCESS getAccess() const;
389  void setAbsolutePath(const char *path);
391  const char *getAbsolutePath() const;
395  void addExclusiveFilter(const char *exclusive_filter);
398  Unigine::Vector<Unigine::String> getExclusiveFilters() const;
402  void addIgnoreFilter(const char *ignore_filter);
405  Unigine::Vector<Unigine::String> getIgnoreFilters() const;
406 };
407 typedef Unigine::Ptr<MountPointParameters> MountPointParametersPtr;
408 
409 } // namespace UnigineEditor
Read-write mode. The mount point access mode is read-write, files contained in the mounted folder/pac...
Definition: UnigineAssetManager.h:378
ACCESS
Access mode.
Definition: UnigineAssetManager.h:373
This class is used to manage assets in the Editor. You can check if an asset with the specified GUID ...
Definition: UnigineAssetManager.h:26
This class is used to manage parameters of mount points, such as access, path, filters....
Definition: UnigineAssetManager.h:369