diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-06-28 17:43:33 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-06-28 17:43:33 +0200 |
| commit | 1393bc318e61b57e2cd6906a6abd3fb4607111c7 (patch) | |
| tree | d2160440f1d642fe3eada811eb1d7edc392b8645 | |
| parent | 298c01eaebb50a5756455ff6ffd49289a214b624 (diff) | |
| download | Project-Tick-1393bc318e61b57e2cd6906a6abd3fb4607111c7.tar.gz Project-Tick-1393bc318e61b57e2cd6906a6abd3fb4607111c7.zip | |
Rename nbt_value to value
| -rw-r--r-- | include/tag_compound.h | 18 | ||||
| -rw-r--r-- | include/value.h (renamed from include/nbt_value.h) | 42 |
2 files changed, 30 insertions, 30 deletions
diff --git a/include/tag_compound.h b/include/tag_compound.h index 51f0cd2709..e0426dbf74 100644 --- a/include/tag_compound.h +++ b/include/tag_compound.h @@ -21,7 +21,7 @@ #define TAG_COMPOUND_H_INCLUDED #include "tag.h" -#include "nbt_value.h" +#include "value.h" #include <map> #include <memory> #include <string> @@ -43,27 +43,27 @@ public: ///Constructs an empty compound tag_compound() {} - //TODO: Make a separate class similar to and convertible to nbt_value for initializing tag values - //tag_compound(std::initializer_list<std::pair<std::string, nbt_value&&>> init); + //TODO: Make a separate class similar to and convertible to value for initializing tag values + //tag_compound(std::initializer_list<std::pair<std::string, value&&>> init); /** * @brief Accesses a tag by key with bounds checking * - * Returns a nbt_value to the tag with the specified key, or throws an + * Returns a value to the tag with the specified key, or throws an * exception if it does not exist. * @throw std::out_of_range if given key does not exist */ - nbt_value& at(const std::string& key); - const nbt_value& at(const std::string& key) const; + value& at(const std::string& key); + const value& at(const std::string& key) const; /** * @brief Accesses a tag by key * - * If the key exists, returns a nbt_value to the corresponding tag. + * If the key exists, returns a value to the corresponding tag. * Else, a new uninitalized entry is created under this key. */ - nbt_value& operator[](const std::string& key); - const nbt_value& operator[](const std::string& key) const; + value& operator[](const std::string& key); + const value& operator[](const std::string& key) const; /** * @brief Erases a tag from the compound diff --git a/include/nbt_value.h b/include/value.h index 786d5e81eb..4553b3e8f4 100644 --- a/include/nbt_value.h +++ b/include/value.h @@ -34,21 +34,21 @@ class tag_list; /** * @brief Contains an NBT value of fixed type * - * A wrapper class that can contain a value of an arbitrary but fixed type. + * A wrapper class that can contain a tag of an arbitrary but fixed type. * Casting or assigning incompatible types will throw an exception. * It can also refer to an uninitialized value (e.g. when using tag_compound::operator[] * with a non-existant key). */ -class nbt_value +class value { public: //Movable but not (implicitly) copyable - nbt_value(const nbt_value&) = delete; - nbt_value(nbt_value&&) = default; - nbt_value& operator=(const nbt_value&) = delete; - nbt_value& operator=(nbt_value&&) = default; + value(const value&) = delete; + value(value&&) = default; + value& operator=(const value&) = delete; + value& operator=(value&&) = default; - //nbt_value& operator=(std::unique_ptr<tag>&& ptr); + //value& operator=(std::unique_ptr<tag>&& ptr); //Assignment /** @@ -56,15 +56,15 @@ public: * @throw std::bad_cast if the value is not convertible to the tag type * via a widening conversion */ - nbt_value& operator=(int8_t val); - nbt_value& operator=(int16_t val); - nbt_value& operator=(int32_t val); - nbt_value& operator=(int64_t val); - nbt_value& operator=(float val); - nbt_value& operator=(double val); - nbt_value& operator=(const std::string& str); - nbt_value& operator=(tag_compound&& comp); - nbt_value& operator=(tag_list&& list); + value& operator=(int8_t val); + value& operator=(int16_t val); + value& operator=(int32_t val); + value& operator=(int64_t val); + value& operator=(float val); + value& operator=(double val); + value& operator=(const std::string& str); + value& operator=(tag_compound&& comp); + value& operator=(tag_list&& list); //Conversion to tag operator tag&(); @@ -89,17 +89,17 @@ public: * @throw std::bad_cast if the tag type is not tag_compound * @sa tag_compound::operator[] */ - nbt_value& operator[](const std::string& key); - const nbt_value& operator[](const std::string& key) const; + value& operator[](const std::string& key); + const value& operator[](const std::string& key) const; ///@sa tag::get_type tag_type get_type() const; - friend bool operator==(const nbt_value& lhs, const nbt_value& rhs); - friend bool operator!=(const nbt_value& lhs, const nbt_value& rhs); + friend bool operator==(const value& lhs, const value& rhs); + friend bool operator!=(const value& lhs, const value& rhs); private: - std::unique_ptr<tag> value; + std::unique_ptr<tag> tag_; }; } |
