3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/cereal/schema/dynamic/DynamicValue.h"
5#include "mc/scripting/data_sync/PathQueryError.h"
13namespace Bedrock::DDUI::PathUtility {
17 requires std::is_same_v<T, cereal::DynamicValue>
18MCAPI nonstd::expected<gsl::not_null<T*>, ::Bedrock::DDUI::PathUtility::PathQueryError> queryDataStoreObjectT(
19 cereal::DynamicValue& originalObject,
20 std::string
const& path,
21 std::string
const& dataStoreName,
22 std::string
const& propertyName
25inline nonstd::expected<void, ::Bedrock::DDUI::PathUtility::PathQueryError> setPathOnDataStoreObject(
26 cereal::DynamicValue& originalObject,
27 std::string
const& path,
28 cereal::DynamicValue
const& newData,
29 std::string
const& dataStoreName,
30 std::string
const& propertyName
32 auto result = queryDataStoreObjectT<cereal::DynamicValue>(originalObject, path, dataStoreName, propertyName);
35 return nonstd::make_unexpected(result.error());
38 result.value()->mValue = newData.mValue;
43MCAPI ::std::optional<::std::variant<double, bool, ::std::string>>
44convertToPrimitive(::cereal::DynamicValue
const& obj);
47 expected<::std::vector<::std::variant<::std::string, uint>>, ::Bedrock::DDUI::PathUtility::PathQueryError>
48 parsePath(::std::string
const& wholePath);
50MCNAPI ::std::string rebuildPath(
51 ::std::string
const& datastore,
52 ::std::string
const& property,
53 ::std::vector<::std::variant<::std::string, uint>>
const& tokens,
54 ::std::optional<uint> maxTokenIndex
57MCAPI ::std::optional<::cereal::DynamicValue> stringToDynamicValue(::std::string
const& s);
Definition DynamicValue.h:14
Definition PathQueryError.h:7