|
Botcraft 26.3
|
#include <Tag.hpp>
Public Member Functions | |
| Tag ()=default | |
| template<typename T , std::enable_if_t< std::is_constructible_v< Internal::TagVariant, T && >, bool > = true> | |
| Tag (T &&v) | |
| template<typename T > | |
| bool | is () const |
| template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true> | |
| bool | is_list_of () const |
| template<typename T > | |
| const T & | get () const |
| template<typename T > | |
| T & | get () |
| template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true> | |
| const std::vector< T > & | as_list_of () const |
| template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true> | |
| std::vector< T > & | as_list_of () |
| Empty Tag becomes an empty TagList. | |
| const Tag & | operator[] (const std::string &s) const |
| Tag & | operator[] (const std::string &s) |
| size_t | size () const |
| bool | contains (const std::string &s) const |
Public Member Functions inherited from ProtocolCraft::NetworkType | |
| virtual | ~NetworkType () |
| virtual void | Read (ReadIterator &iter, size_t &length) |
| virtual void | Write (WriteContainer &container) const |
| virtual Json::Value | Serialize () const |
Protected Member Functions | |
| virtual void | ReadImpl (ReadIterator &iter, size_t &length) override |
| virtual void | WriteImpl (WriteContainer &container) const override |
| std::string | ReadNamed (ReadIterator &iter, size_t &length) |
| void | WriteNamed (const std::string &tag_name, WriteContainer &container) const |
| virtual Json::Value | SerializeImpl () const override |
Private Member Functions | |
| void | ReadPayload (const TagType type, ReadIterator &iter, size_t &length) |
| void | WritePayload (WriteContainer &container) const |
Private Attributes | |
| Internal::TagVariant | val |
Friends | |
| class | TagCompound |
|
default |
|
inline |
| std::vector< T > & ProtocolCraft::NBT::Tag::as_list_of | ( | ) |
| const std::vector< T > & ProtocolCraft::NBT::Tag::as_list_of | ( | ) | const |
Definition at line 251 of file Tag.hpp.
References val.
Referenced by Botcraft::Utilities::GetEnchantmentLvl(), and ProtocolCraft::Chat::ParseChatParts().
| bool ProtocolCraft::NBT::Tag::contains | ( | const std::string & | s | ) | const |
Definition at line 122 of file Tag.cpp.
Referenced by Botcraft::Utilities::GetDamageCount(), Botcraft::Utilities::GetEnchantmentLvl(), and Botcraft::World::Handle().
| const T & ProtocolCraft::NBT::Tag::get | ( | ) | const |
Definition at line 224 of file Tag.hpp.
Referenced by get(), Botcraft::Utilities::GetDamageCount(), Botcraft::World::Handle(), and ProtocolCraft::Chat::ParseChatParts().
| bool ProtocolCraft::NBT::Tag::is | ( | ) | const |
Definition at line 198 of file Tag.hpp.
References val.
Referenced by Botcraft::Utilities::GetDamageCount(), ProtocolCraft::Chat::ParseChatParts(), and ProtocolCraft::NBT::TagCompound::ReadImpl().
| bool ProtocolCraft::NBT::Tag::is_list_of | ( | ) | const |
Definition at line 218 of file Tag.hpp.
Referenced by Botcraft::Utilities::GetEnchantmentLvl(), and ProtocolCraft::Chat::ParseChatParts().
| Tag & ProtocolCraft::NBT::Tag::operator[] | ( | const std::string & | s | ) |
Definition at line 84 of file Tag.cpp.
References TagCompound, and val.
| const Tag & ProtocolCraft::NBT::Tag::operator[] | ( | const std::string & | s | ) | const |
|
overrideprotectedvirtual |
Implements ProtocolCraft::NetworkType.
Reimplemented in ProtocolCraft::Chat, ProtocolCraft::NBT::UnnamedValue, ProtocolCraft::NBT::UntrustedValue, and ProtocolCraft::NBT::Value.
Definition at line 128 of file Tag.cpp.
References ReadPayload().
Referenced by ProtocolCraft::Chat::ReadImpl(), ProtocolCraft::NBT::UnnamedValue::ReadImpl(), and ProtocolCraft::NBT::UntrustedValue::ReadImpl().
|
protected |
Definition at line 139 of file Tag.cpp.
References ProtocolCraft::NBT::ReadNBTString(), ReadPayload(), and ProtocolCraft::NBT::TagEnd.
Referenced by ProtocolCraft::NBT::UnnamedValue::ReadImpl(), ProtocolCraft::NBT::Value::ReadImpl(), and ProtocolCraft::NBT::TagCompound::ReadImpl().
|
private |
Definition at line 188 of file Tag.cpp.
References ProtocolCraft::NBT::ReadNBTString(), ProtocolCraft::NBT::TagByte, ProtocolCraft::NBT::TagByteArray, ProtocolCraft::NBT::TagCompound, ProtocolCraft::NBT::TagDouble, ProtocolCraft::NBT::TagEnd, ProtocolCraft::NBT::TagFloat, ProtocolCraft::NBT::TagInt, ProtocolCraft::NBT::TagIntArray, ProtocolCraft::NBT::TagList, ProtocolCraft::NBT::TagLong, ProtocolCraft::NBT::TagLongArray, ProtocolCraft::NBT::TagShort, ProtocolCraft::NBT::TagString, and val.
Referenced by ReadImpl(), and ReadNamed().
|
overrideprotectedvirtual |
Implements ProtocolCraft::NetworkType.
Definition at line 157 of file Tag.cpp.
References ProtocolCraft::Json::Value::get(), and val.
| size_t ProtocolCraft::NBT::Tag::size | ( | ) | const |
Definition at line 94 of file Tag.cpp.
References val.
Referenced by ProtocolCraft::NBT::UntrustedValue::ReadImpl().
|
overrideprotectedvirtual |
Implements ProtocolCraft::NetworkType.
Reimplemented in ProtocolCraft::NBT::UnnamedValue, ProtocolCraft::NBT::UntrustedValue, and ProtocolCraft::NBT::Value.
Definition at line 133 of file Tag.cpp.
References val, and WritePayload().
Referenced by ProtocolCraft::NBT::UnnamedValue::WriteImpl(), and ProtocolCraft::NBT::UntrustedValue::WriteImpl().
|
protected |
Definition at line 147 of file Tag.cpp.
References val, ProtocolCraft::NBT::WriteNBTString(), and WritePayload().
Referenced by ProtocolCraft::NBT::UnnamedValue::WriteImpl(), and ProtocolCraft::NBT::Value::WriteImpl().
|
private |
Definition at line 241 of file Tag.cpp.
References val, and ProtocolCraft::NBT::WriteNBTString().
Referenced by WriteImpl(), and WriteNamed().
|
friend |
Definition at line 135 of file Tag.hpp.
Referenced by operator[]().
|
private |
Definition at line 138 of file Tag.hpp.
Referenced by as_list_of(), as_list_of(), get(), is(), operator[](), operator[](), ReadPayload(), SerializeImpl(), size(), WriteImpl(), WriteNamed(), and WritePayload().