Botcraft 26.3
Loading...
Searching...
No Matches
ProtocolCraft::NBT::Value Class Reference

#include <NBT.hpp>

Inheritance diagram for ProtocolCraft::NBT::Value:
ProtocolCraft::NBT::Tag ProtocolCraft::NetworkType

Public Member Functions

 Value ()
 
 Value (TagCompound c, std::string root_name="")
 
 Value (const UnnamedValue &unnamed)
 
 Value (UnnamedValue &&unnamed)
 
 Value (const UntrustedValue &untrusted)
 
 Value (UntrustedValue &&untrusted)
 
virtual ~Value () override
 
bool HasData () const
 
const std::string & GetName () const
 
- Public Member Functions inherited from ProtocolCraft::NBT::Tag
 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
 
- Protected Member Functions inherited from ProtocolCraft::NBT::Tag
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 Attributes

std::string name
 

Friends

std::istream & operator>> (std::istream &is, Value &v)
 

Detailed Description

Definition at line 41 of file NBT.hpp.

Constructor & Destructor Documentation

◆ Value() [1/6]

ProtocolCraft::NBT::Value::Value ( )

Definition at line 92 of file NBT.cpp.

◆ Value() [2/6]

ProtocolCraft::NBT::Value::Value ( TagCompound  c,
std::string  root_name = "" 
)

Definition at line 97 of file NBT.cpp.

◆ Value() [3/6]

ProtocolCraft::NBT::Value::Value ( const UnnamedValue &  unnamed)

Definition at line 102 of file NBT.cpp.

◆ Value() [4/6]

ProtocolCraft::NBT::Value::Value ( UnnamedValue &&  unnamed)

Definition at line 107 of file NBT.cpp.

◆ Value() [5/6]

ProtocolCraft::NBT::Value::Value ( const UntrustedValue &  untrusted)

Definition at line 113 of file NBT.cpp.

◆ Value() [6/6]

ProtocolCraft::NBT::Value::Value ( UntrustedValue &&  untrusted)

Definition at line 118 of file NBT.cpp.

◆ ~Value()

ProtocolCraft::NBT::Value::~Value ( )
overridevirtual

Definition at line 124 of file NBT.cpp.

Member Function Documentation

◆ GetName()

const std::string & ProtocolCraft::NBT::Value::GetName ( ) const

Definition at line 134 of file NBT.cpp.

References name.

◆ HasData()

bool ProtocolCraft::NBT::Value::HasData ( ) const

◆ ReadImpl()

void ProtocolCraft::NBT::Value::ReadImpl ( ReadIterator &  iter,
size_t &  length 
)
overrideprotectedvirtual

Reimplemented from ProtocolCraft::NBT::Tag.

Definition at line 154 of file NBT.cpp.

References ProtocolCraft::ExtractGZip(), name, and ProtocolCraft::NBT::Tag::ReadNamed().

◆ WriteImpl()

void ProtocolCraft::NBT::Value::WriteImpl ( WriteContainer &  container) const
overrideprotectedvirtual

Reimplemented from ProtocolCraft::NBT::Tag.

Definition at line 180 of file NBT.cpp.

References name, and ProtocolCraft::NBT::Tag::WriteNamed().

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream &  is,
Value &  v 
)
friend

Definition at line 139 of file NBT.cpp.

Member Data Documentation

◆ name

std::string ProtocolCraft::NBT::Value::name
private

Definition at line 64 of file NBT.hpp.

Referenced by GetName(), ReadImpl(), and WriteImpl().


The documentation for this class was generated from the following files: