UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AssetDataGathererDiscoveryCache.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Containers/Map.h"
11#include "HAL/PlatformFile.h"
12#include "Misc/DateTime.h"
13
14class FArchive;
15
17{
18
20{
21 Never,
23 Always
24};
25
27{
28 NeverRead = 0x00,
29 DefaultRead = 0x01,
30 AlwaysRead = 0x02,
31 ReadMask = 0x0f,
32 NeverWrite = 0x00,
33 DefaultWrite = 0x10,
34 AlwaysWrite = 0x20,
35 WriteMask = 0xf0,
36 Invalid = 0xffffffff,
44 AlwaysWriteDefaultRead = AlwaysWrite | DefaultRead, // aka AlwaysWrite
45 // NOT given the nickname "Always", because skipping invalidation is not what users would expect from "Always"
47};
50
59
80
88
121
132{
133public:
134 FString GetCacheFileName() const;
135
136 bool IsInitialized() const { return bInitialized; }
137 EFeatureEnabled IsWriteEnabled() const { return WriteEnabled; }
138 void Shutdown();
139
140 void LoadAndUpdateCache();
141 void SaveCache();
142
146 void RemoveDir(FStringView Path);
147
151
152 void QueueConsume();
154 void QueueAdd(FString DirName, FFileJournalFileHandle JournalHandle, bool bIsReparsePoint);
155
156private:
157 bool TryReadCacheFile();
158 void SerializeReadCacheFile(FArchive& Ar, bool& bOutCacheVersionMismatch);
159 void SerializeWriteCacheFile(FArchive& Ar);
160
161 bool FindOrAddIsReparsePoint(FStringView DirName, FCachedVolumeInfo& CachedVolume);
162
163private:
169 TMpscQueue<FDiscoveredSubDirData> ScanQueueDirHandles;
170
172 bool bInitialized = false;
175};
176
177constexpr const TCHAR* GEmptyVolumeName = TEXT("<EmptyVolume>");
178
179} // UE::AssetDataGather::Private
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
const FFileJournalFileHandle FileJournalFileHandleInvalid
Definition GenericPlatformFile.cpp:1082
uint64 FFileJournalEntryHandle
Definition GenericPlatformFile.h:250
constexpr FFileJournalId FileJournalIdInvalid
Definition GenericPlatformFile.h:245
uint64 FFileJournalId
Definition GenericPlatformFile.h:244
constexpr FFileJournalEntryHandle FileJournalEntryHandleInvalid
Definition GenericPlatformFile.h:251
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition MpscQueue.h:18
Definition SortedMap.h:20
Definition AssetDataGathererDiscoveryCache.h:132
FCachedVolumeInfo * FindVolume(FStringView PathOrVolumeName)
Definition AssetDataGathererDiscoveryCache.cpp:416
FString GetCacheFileName() const
Definition AssetDataGathererDiscoveryCache.cpp:36
void Shutdown()
Definition AssetDataGathererDiscoveryCache.cpp:360
void QueueAdd(FString DirName, FCachedDirScanDir DirData)
Definition AssetDataGathererDiscoveryCache.cpp:565
EFeatureEnabled IsWriteEnabled() const
Definition AssetDataGathererDiscoveryCache.h:137
void SaveCache()
Definition AssetDataGathererDiscoveryCache.cpp:236
void RemoveDir(FStringView Path)
Definition AssetDataGathererDiscoveryCache.cpp:402
FCachedDirScanDir * FindDir(FStringView Path, FCachedVolumeInfo **OutVolume=nullptr)
Definition AssetDataGathererDiscoveryCache.cpp:426
void LoadAndUpdateCache()
Definition AssetDataGathererDiscoveryCache.cpp:42
FCachedDirScanDir & FindOrAddDir(FStringView Path, FCachedVolumeInfo **OutVolume=nullptr)
Definition AssetDataGathererDiscoveryCache.cpp:392
FCachedVolumeInfo & FindOrAddVolume(FStringView PathOrVolumeName)
Definition AssetDataGathererDiscoveryCache.cpp:377
void QueueConsume()
Definition AssetDataGathererDiscoveryCache.cpp:490
bool IsInitialized() const
Definition AssetDataGathererDiscoveryCache.h:136
Definition AssetDataGathererDiscoveryCache.h:91
void ConditionalConstruct(const FString &InVolumeName)
Definition AssetDataGathererDiscoveryCache.cpp:583
bool bJournalAvailable
Definition AssetDataGathererDiscoveryCache.h:118
TArray< FString > DirsToRemove
Definition AssetDataGathererDiscoveryCache.h:113
FCachedDirScanDir & FindOrAddDir(FStringView InPath)
Definition AssetDataGathererDiscoveryCache.cpp:624
FFileJournalId JournalIdOnDisk
Definition AssetDataGathererDiscoveryCache.h:115
FFileJournalEntryHandle NextJournalEntryOnDisk
Definition AssetDataGathererDiscoveryCache.h:116
TMap< FString, FCachedDirScanDir > Dirs
Definition AssetDataGathererDiscoveryCache.h:106
void PreSave()
Definition AssetDataGathererDiscoveryCache.cpp:593
FCachedDirScanDir * FindDir(FStringView Path)
Definition AssetDataGathererDiscoveryCache.cpp:660
void InitializePlatformData()
Definition AssetDataGathererDiscoveryCache.cpp:598
uint64 JournalMaximumSize
Definition AssetDataGathererDiscoveryCache.h:117
FFileJournalId JournalId
Definition AssetDataGathererDiscoveryCache.h:108
void RemoveDirs(TArray< FString > &&InPaths)
Definition AssetDataGathererDiscoveryCache.cpp:642
FString LastError
Definition AssetDataGathererDiscoveryCache.h:114
FString VolumeName
Definition AssetDataGathererDiscoveryCache.h:107
FFileJournalEntryHandle NextJournalEntryToScan
Definition AssetDataGathererDiscoveryCache.h:109
Definition AssetDataGatherer.cpp:50
FArchive & operator<<(FArchive &Ar, FCachedVolumeInfo &Data)
Definition AssetDataGathererDiscoveryCache.cpp:666
EFeatureEnabled
Definition AssetDataGathererDiscoveryCache.h:20
void LexFromString(EFeatureEnabledReadWrite &OutValue, FStringView Text)
Definition AssetDataGatherer.cpp:64
EFeatureEnabledReadWrite
Definition AssetDataGathererDiscoveryCache.h:27
constexpr const TCHAR * GEmptyVolumeName
Definition AssetDataGathererDiscoveryCache.h:177
Definition DateTime.h:76
Definition GenericPlatformFile.h:257
Definition Optional.h:131
Definition AssetDataGathererDiscoveryCache.h:62
FFileJournalFileHandle JournalHandle
Definition AssetDataGathererDiscoveryCache.h:65
TOptional< bool > bIsInsideReparsePoint
Definition AssetDataGathererDiscoveryCache.h:77
bool bCacheValid
Definition AssetDataGathererDiscoveryCache.h:66
TArray< FString > SubDirRelPaths
Definition AssetDataGathererDiscoveryCache.h:63
TOptional< bool > bIsReparsePoint
Definition AssetDataGathererDiscoveryCache.h:72
TArray< FCachedDirScanFile > Files
Definition AssetDataGathererDiscoveryCache.h:64
Definition AssetDataGathererDiscoveryCache.h:53
bool bIsReadOnly
Definition AssetDataGathererDiscoveryCache.h:56
FString RelPath
Definition AssetDataGathererDiscoveryCache.h:54
FDateTime ModificationTime
Definition AssetDataGathererDiscoveryCache.h:55
Definition AssetDataGathererDiscoveryCache.h:83
TOptional< bool > bIsReparsePoint
Definition AssetDataGathererDiscoveryCache.h:86
FString DirNameAbsPath
Definition AssetDataGathererDiscoveryCache.h:84
FFileJournalFileHandle JournalHandle
Definition AssetDataGathererDiscoveryCache.h:85