| 900 | #if USE_EDITOR |
| 901 | |
| 902 | bool FlaxStorage::Create(const StringView& path, Span<AssetInitData> assets, bool silentMode, const CustomData* customData) |
| 903 | { |
| 904 | PROFILE_CPU(); |
| 905 | ZoneText(*path, path.Length()); |
| 906 | LOG(Info, "Creating package at \'{0}\'. Silent Mode: {1}", path, silentMode); |
| 907 | |
| 908 | // Prepare to have access to the file |
| 909 | auto storage = ContentStorageManager::EnsureAccess(path); |
| 910 | |
| 911 | // Open file |
| 912 | auto stream = FileWriteStream::Open(path); |
| 913 | if (stream == nullptr) |
| 914 | return true; |
| 915 | |
| 916 | // Create package |
| 917 | bool result = Create(stream, assets, customData); |
| 918 | |
| 919 | // Close file |
| 920 | Delete(stream); |
| 921 | |
| 922 | // Reload storage container |
| 923 | if (storage && storage->IsLoaded()) |
| 924 | { |
| 925 | if (silentMode) |
| 926 | { |
| 927 | // Silent data-only reload (loaded chunks location in file has been updated) |
| 928 | storage->ReloadSilent(); |
| 929 | } |
| 930 | else |
| 931 | { |
| 932 | // Full reload |
| 933 | storage->Reload(); |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | return result; |
| 938 | } |
| 939 | |
| 940 | bool FlaxStorage::Create(WriteStream* stream, Span<AssetInitData> assets, const CustomData* customData) |
| 941 | { |
no test coverage detected