Commit b6c43e90 authored by Aaron Burghardt's avatar Aaron Burghardt Committed by Nikias Bassen

Added const to Array.GetSize(), and to 3 Node methods.

parent ccd6f05f
...@@ -44,7 +44,7 @@ public : ...@@ -44,7 +44,7 @@ public :
void Insert(Node* node, unsigned int pos); void Insert(Node* node, unsigned int pos);
void Remove(Node* node); void Remove(Node* node);
void Remove(unsigned int pos); void Remove(unsigned int pos);
unsigned int GetNodeIndex(Node* node); unsigned int GetNodeIndex(Node* node) const;
private : private :
std::vector<Node*> _array; std::vector<Node*> _array;
......
...@@ -34,10 +34,10 @@ class Structure : public Node ...@@ -34,10 +34,10 @@ class Structure : public Node
public : public :
virtual ~Structure(); virtual ~Structure();
uint32_t GetSize(); uint32_t GetSize() const;
std::string ToXml(); std::string ToXml() const;
std::vector<char> ToBin(); std::vector<char> ToBin() const;
virtual void Remove(Node* node) = 0; virtual void Remove(Node* node) = 0;
......
...@@ -141,9 +141,9 @@ void Array::Remove(unsigned int pos) ...@@ -141,9 +141,9 @@ void Array::Remove(unsigned int pos)
_array.erase(it); _array.erase(it);
} }
unsigned int Array::GetNodeIndex(Node* node) unsigned int Array::GetNodeIndex(Node* node) const
{ {
std::vector<Node*>::iterator it = std::find(_array.begin(), _array.end(), node); std::vector<Node*>::const_iterator it = std::find(_array.begin(), _array.end(), node);
return std::distance (_array.begin(), it); return std::distance (_array.begin(), it);
} }
......
...@@ -35,7 +35,7 @@ Structure::~Structure() ...@@ -35,7 +35,7 @@ Structure::~Structure()
{ {
} }
uint32_t Structure::GetSize() uint32_t Structure::GetSize() const
{ {
uint32_t size = 0; uint32_t size = 0;
plist_type type = plist_get_node_type(_node); plist_type type = plist_get_node_type(_node);
...@@ -50,7 +50,7 @@ uint32_t Structure::GetSize() ...@@ -50,7 +50,7 @@ uint32_t Structure::GetSize()
return size; return size;
} }
std::string Structure::ToXml() std::string Structure::ToXml() const
{ {
char* xml = NULL; char* xml = NULL;
uint32_t length = 0; uint32_t length = 0;
...@@ -60,7 +60,7 @@ std::string Structure::ToXml() ...@@ -60,7 +60,7 @@ std::string Structure::ToXml()
return ret; return ret;
} }
std::vector<char> Structure::ToBin() std::vector<char> Structure::ToBin() const
{ {
char* bin = NULL; char* bin = NULL;
uint32_t length = 0; uint32_t length = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment