UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AssetBundleData.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"
7#include "CoreTypes.h"
9#include "UObject/Class.h"
10#include "UObject/NameTypes.h"
15
16#include "AssetBundleData.generated.h"
17
18class FOutputDevice;
19class UObject;
20
22USTRUCT()
24{
26public:
31 // Explicitly declared constructors/operators because we explicitly declared the destructor to hide deprecation warnings.
32 // These can be removed along with the destructor after deprecation.
38
40 UPROPERTY()
41 FName BundleName;
42
43#if WITH_EDITORONLY_DATA
45 UE_DEPRECATED(5.1, "BundleAssets has been replaced with AssetPaths.")
46 UPROPERTY(meta=(DeprecatedProperty, DeprecationMessage="Asset bundles may only contain top level asset paths which are referenced through the AssetPaths property."))
48#endif
49
51 UPROPERTY()
53
55 : BundleName(InBundleName)
56 {
57
58 }
59
61 bool IsValid() const { return !BundleName.IsNone(); }
62
65 {
66 // Ignore deprecated fields for equality checks
67 return BundleName == Other.BundleName
68 && AssetPaths == Other.AssetPaths;
69 }
71 {
72 return !(*this == Other);
73 }
74
75 COREUOBJECT_API bool ExportTextItem(FString& ValueStr, const FAssetBundleEntry& DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope) const;
76 COREUOBJECT_API bool ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText);
77};
78
80USTRUCT()
82{
84public:
85
93
95 UPROPERTY()
97
99 bool operator==(const FAssetBundleData& Other) const
100 {
101 return Bundles == Other.Bundles;
102 }
104 {
105 return !(*this == Other);
106 }
107
110
112 UE_DEPRECATED(5.1, "The contents of an asset bundle now use FTopLevelAssetPath instead of FSoftObjectPath.")
113 COREUOBJECT_API void AddBundleAsset(FName BundleName, const FSoftObjectPath& AssetPath);
114
115 template< typename T >
116 UE_DEPRECATED(5.1, "The contents of an asset bundle now use FTopLevelAssetPath instead of FSoftObjectPath.")
117 void AddBundleAsset(FName BundleName, const TSoftObjectPtr<T>& SoftObjectPtr)
118 {
119 AddBundleAsset(BundleName, SoftObjectPtr.ToSoftObjectPath().GetAssetPath());
120 }
121
123 UE_DEPRECATED(5.1, "The contents of an asset bundle now use FTopLevelAssetPath instead of FSoftObjectPath.")
124 COREUOBJECT_API void AddBundleAssets(FName BundleName, const TArray<FSoftObjectPath>& AssetPaths);
125
127 UE_DEPRECATED(5.1, "The contents of an asset bundle now use FTopLevelAssetPath instead of FSoftObjectPath.")
128 COREUOBJECT_API void SetBundleAssets(FName BundleName, TArray<FSoftObjectPath>&& AssetPaths);
129
131 COREUOBJECT_API void AddBundleAsset(FName BundleName, const FTopLevelAssetPath& AssetPath);
132
134 COREUOBJECT_API void AddBundleAssets(FName BundleName, const TArray<FTopLevelAssetPath>& AssetPaths);
135
137 COREUOBJECT_API void SetBundleAssets(FName BundleName, TArray<FTopLevelAssetPath>&& AssetPaths);
138
140 COREUOBJECT_API void AddBundleAssetTruncated(FName BundleName, const FSoftObjectPath& AssetPath);
141
143 COREUOBJECT_API void AddBundleAssetsTruncated(FName BundleName, const TArray<FSoftObjectPath>& AssetPaths);
144
146 COREUOBJECT_API void SetBundleAssetsTruncated(FName BundleName, const TArray<FSoftObjectPath>& AssetPaths);
147
149 COREUOBJECT_API void Reset();
150
152 COREUOBJECT_API bool ExportTextItem(FString& ValueStr, FAssetBundleData const& DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope) const;
153 COREUOBJECT_API bool ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText);
154
155 COREUOBJECT_API FString ToDebugString() const;
156};
157
158template<>
160{
161 enum
162 {
163 WithExportTextItem = true,
164 WithImportTextItem = true,
165 };
166};
GLenum GLuint GLint level
Definition AndroidOpenGLFunctions.h:46
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
Definition NameTypes.h:617
FORCEINLINE bool IsNone() const
Definition NameTypes.h:827
Definition UnrealType.h:3087
Definition OutputDevice.h:133
Definition Array.h:670
Definition Object.h:95
Definition AssetBundleData.h:82
FAssetBundleData(FAssetBundleData &&)=default
FAssetBundleData & operator=(FAssetBundleData &&)=default
FAssetBundleData & operator=(const FAssetBundleData &)=default
FAssetBundleData(const FAssetBundleData &)=default
bool operator!=(const FAssetBundleData &Other) const
Definition AssetBundleData.h:103
UE_FORCEINLINE_HINT FAssetBundleData()
Definition AssetBundleData.h:87
UE_FORCEINLINE_HINT ~FAssetBundleData()
Definition AssetBundleData.h:88
Definition AssetBundleData.h:24
PRAGMA_DISABLE_DEPRECATION_WARNINGS UE_FORCEINLINE_HINT ~FAssetBundleEntry()
Definition AssetBundleData.h:30
FAssetBundleEntry & operator=(const FAssetBundleEntry &)=default
UE_FORCEINLINE_HINT FAssetBundleEntry()
Definition AssetBundleData.h:28
bool operator!=(const FAssetBundleEntry &Other) const
Definition AssetBundleData.h:70
bool operator==(const FAssetBundleEntry &Other) const
Definition AssetBundleData.h:64
FAssetBundleEntry(const FAssetBundleEntry &)=default
bool IsValid() const
Definition AssetBundleData.h:61
FAssetBundleEntry(FAssetBundleEntry &&)=default
FAssetBundleEntry & operator=(FAssetBundleEntry &&)=default
Definition SoftObjectPath.h:56
Definition TopLevelAssetPath.h:38
Definition SoftObjectPtr.h:174
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46