From 7219e74c7ca47013fb5fe99707f38ae7417257af Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 7 Mar 2012 22:09:55 +0000 Subject: Anvil format: loading chests' contents. git-svn-id: http://mc-server.googlecode.com/svn/trunk@385 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/NBT.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source/NBT.h') diff --git a/source/NBT.h b/source/NBT.h index 5bad0492c..a05e574de 100644 --- a/source/NBT.h +++ b/source/NBT.h @@ -62,8 +62,8 @@ public: static cNBTTag * CreateTag(cNBTTag * a_Parent, eTagType a_Type, const AString & a_Name); // Creates a new instance of a tag specified by iType, uses the correct class - virtual cNBTTag * FindChildByName(const AString & a_Name) {return NULL; } - cNBTTag * FindChildByPath(const AString & a_Path); + virtual cNBTTag * FindChildByName(const AString & a_Name) const {return NULL; } + const cNBTTag * FindChildByPath(const AString & a_Path) const; } ; typedef cNBTTag cNBTTree; @@ -118,7 +118,7 @@ public: cNBTTag * GetChildByIdx (size_t a_Index); const cNBTTags & GetChildren (void) const {return m_Children; } size_t GetChildrenCount(void) const {return m_Children.size(); } - virtual cNBTTag * FindChildByName (const AString & a_Name) override; + virtual cNBTTag * FindChildByName (const AString & a_Name) const override; int SetChildrenType(eTagType a_Type); // Only valid when list empty eTagType GetChildrenType(void) const {return m_ChildrenType; } @@ -142,7 +142,7 @@ public: cNBTTag * GetChildByIdx (size_t a_Index); const cNBTTags & GetChildren (void) const {return m_Children; } size_t GetChildrenCount(void) const {return m_Children.size(); } - virtual cNBTTag * FindChildByName (const AString & a_Name) override; + virtual cNBTTag * FindChildByName (const AString & a_Name) const override; } ; @@ -199,3 +199,14 @@ public: + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Dumping the tree (DEBUG-only) + +#ifdef _DEBUG +void DumpTree(const cNBTTree * a_Tree, int a_Level = 0); +#endif // _DEBUG + + + + -- cgit v1.2.3