* @brief Write a UE FString to an mjString* field, but only if non-empty. * * Replaces the gated pattern: * if (!Name.IsEmpty()) mjs_setString(Element->name, TCHAR_TO_UTF8(*Name)); * with: * MjSetString(Element->name, Name); * * @param Field The mjString* field (e.g. Element->childclass). * @param Value The UE FString to write. No-op if empty. */
| 195 | * @param Value The UE FString to write. No-op if empty. |
| 196 | */ |
| 197 | inline void MjSetString(mjString* Field, const FString& Value) |
| 198 | { |
| 199 | if (!Value.IsEmpty()) |
| 200 | { |
| 201 | mjs_setString(Field, TCHAR_TO_UTF8(*Value)); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * @brief Unconditionally write a UE FString to an mjString* field. |