LeviLamina
Loading...
Searching...
No Matches
PersistenceGroup.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/editor/PersistenceGroupItemChangeAction.h"
7#include "mc/common/editor/PersistenceGroupType.h"
8#include "mc/common/editor/PersistenceScope.h"
9#include "mc/deps/core/file/PathBuffer.h"
10#include "mc/deps/game_refs/EnableGetWeakRef.h"
11#include "mc/deps/game_refs/StackRefResult.h"
12#include "mc/deps/game_refs/WeakRef.h"
13#include "mc/deps/scripting/runtime/Result_deprecated.h"
14
15// auto generated forward declare list
16// clang-format off
17namespace Bedrock::PubSub { class Subscription; }
18namespace Editor::Services { class PersistenceItem; }
19namespace cereal { struct ReflectionCtx; }
20// clang-format on
21
22namespace Editor::Services {
23
24class PersistenceGroup : public ::EnableGetWeakRef<::Editor::Services::PersistenceGroup>,
25 public ::std::enable_shared_from_this<::Editor::Services::PersistenceGroup> {
26public:
27 // member variables
28 // NOLINTBEGIN
39 // NOLINTEND
40
41public:
42 // prevent constructor by default
43 PersistenceGroup& operator=(PersistenceGroup const&);
44 PersistenceGroup(PersistenceGroup const&);
45 PersistenceGroup();
46
47public:
48 // member functions
49 // NOLINTBEGIN
52 int version,
53 ::Editor::Services::PersistenceScope scope,
54 ::std::string& groupNamespace,
55 ::std::string& name,
56 ::Editor::Services::PersistenceGroupType groupType,
57 ::cereal::ReflectionCtx& cerealContext
58 );
59
60 MCNAPI ::std::string _getValidKeyName(::std::string const& key) const;
61
62 MCNAPI bool _hasItem(::std::string const& itemName) const;
63
64 MCNAPI void _loadItems();
65
67
68 MCNAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem>>
69 createItem(::std::string const& itemName, ::std::optional<::std::string> defaultJsonValue);
70
71 MCNAPI ::Scripting::Result_deprecated<void> deleteItem(::std::string const& itemName);
72
73 MCNAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem>>
74 fetchItem(::std::string const& itemName) const;
75
76 MCNAPI ::Editor::Services::PersistenceGroupType const getGroupType() const;
77
78 MCNAPI ::std::string getNamespaceVersionedName() const;
79
80 MCNAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem>>
81 getOrCreateItem(::std::string const& itemName, ::std::optional<::std::string> defaultJsonValue);
82
83 MCNAPI ::Editor::Services::PersistenceScope getScope() const;
84
85 MCNAPI int const getVersion() const;
86
87 MCNAPI ::WeakRef<::Editor::Services::PersistenceGroup> const getWeakRef();
88
89 MCNAPI ::std::vector<::std::string> listItems() const;
90
91 MCNAPI ::Bedrock::PubSub::Subscription onItemChange(
92 ::std::function<void(
93 ::Editor::Services::PersistenceGroupItemChangeAction,
95 )> callback
96 );
97
98 MCNAPI bool operator==(::Editor::Services::PersistenceGroup const& other) const;
99
101 // NOLINTEND
102
103public:
104 // constructor thunks
105 // NOLINTBEGIN
106 MCNAPI void* $ctor(
108 int version,
109 ::Editor::Services::PersistenceScope scope,
110 ::std::string& groupNamespace,
111 ::std::string& name,
112 ::Editor::Services::PersistenceGroupType groupType,
113 ::cereal::ReflectionCtx& cerealContext
114 );
115 // NOLINTEND
116
117public:
118 // destructor thunk
119 // NOLINTBEGIN
120 MCNAPI void $dtor();
121 // NOLINTEND
122};
123
124} // namespace Editor::Services
Definition Subscription.h:10
Definition PathBuffer.h:8
Definition PersistenceGroup.h:25
MCAPI bool _hasItem(::std::string const &itemName) const
MCAPI::std::string _getValidKeyName(::std::string const &key) const
MCAPI void _notifyItemChanged(::Editor::Services::PersistenceItem const &item)
MCAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem > > createItem(::std::string const &itemName, ::std::optional<::std::string > defaultJsonValue)
MCAPI::Bedrock::PubSub::Subscription onItemChange(::std::function< void(::Editor::Services::PersistenceGroupItemChangeAction, ::StackRefResult<::Editor::Services::PersistenceItem > &)> callback)
MCAPI bool operator==(::Editor::Services::PersistenceGroup const &other) const
MCAPI ::Scripting::Result_deprecated< void > deleteItem(::std::string const &itemName)
MCAPI PersistenceGroup(::Core::PathBuffer<::std::string > &path, int version, ::Editor::Services::PersistenceScope scope, ::std::string &groupNamespace, ::std::string &name, ::Editor::Services::PersistenceGroupType groupType, ::cereal::ReflectionCtx &cerealContext)
MCAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem > > fetchItem(::std::string const &itemName) const
MCAPI ::WeakRef<::Editor::Services::PersistenceGroup > const getWeakRef()
MCAPI::Editor::Services::PersistenceScope getScope() const
MCAPI void * $ctor(::Core::PathBuffer<::std::string > &path, int version, ::Editor::Services::PersistenceScope scope, ::std::string &groupNamespace, ::std::string &name, ::Editor::Services::PersistenceGroupType groupType, ::cereal::ReflectionCtx &cerealContext)
MCAPI int const getVersion() const
MCAPI ::Scripting::Result_deprecated<::StackRefResult<::Editor::Services::PersistenceItem > > getOrCreateItem(::std::string const &itemName, ::std::optional<::std::string > defaultJsonValue)
MCAPI ::std::vector<::std::string > listItems() const
MCAPI::Editor::Services::PersistenceGroupType const getGroupType() const
MCAPI::std::string getNamespaceVersionedName() const
Definition PersistenceItem.h:19
Definition EnableGetWeakRef.h:6
Definition StackRefResult.h:7
Definition ReflectionCtx.h:11
Definition Alias.h:14