FSoftObjectPath::AppendString
#include "UObject/SoftObjectPath.h"
Access: public
Description
Appends the full path string representation to an existing FString or string builder without allocating a new string. Prefer this over ToString() when building composite strings.
Caveats & Gotchas
- • The FString overload appends to an already-allocated FString. The FStringBuilderBase and FUtf8StringBuilderBase overloads use the more efficient TStringBuilder path — prefer those in performance-sensitive code.
- • For a null path, this appends nothing. The caller cannot distinguish a null path from an empty-string path by checking the builder's length before and after the call.
Signature
COREUOBJECT_API void AppendString(FString& Builder) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Builder | FString& | The FString to append the path representation into. | — |
Return Type
void Example
Build a composite log string without extra allocations C++
TStringBuilder<256> Builder;
Builder << TEXT("Loading asset: ");
MyAssetRef.AppendString(Builder);
UE_LOG(LogTemp, Log, TEXT("%s"), Builder.ToString()); See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?