diff options
| author | 2014-08-16 17:48:45 -0400 | |
|---|---|---|
| committer | 2014-09-20 00:10:46 +0200 | |
| commit | b6c43e901c1ee3ded15261621be1aaa090dab984 (patch) | |
| tree | 218257fc8751fc0fc979d292acd9162278cadcd7 | |
| parent | ccd6f05fe1e6cd5a1611b0df78974fa39869013d (diff) | |
| download | libplist-b6c43e901c1ee3ded15261621be1aaa090dab984.tar.gz libplist-b6c43e901c1ee3ded15261621be1aaa090dab984.tar.bz2 | |
Added const to Array.GetSize(), and to 3 Node methods.
| -rw-r--r-- | include/plist/Array.h | 2 | ||||
| -rw-r--r-- | include/plist/Structure.h | 6 | ||||
| -rw-r--r-- | src/Array.cpp | 4 | ||||
| -rw-r--r-- | src/Structure.cpp | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/include/plist/Array.h b/include/plist/Array.h index 69ff26f..745b750 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h | |||
| @@ -44,7 +44,7 @@ public : | |||
| 44 | void Insert(Node* node, unsigned int pos); | 44 | void Insert(Node* node, unsigned int pos); |
| 45 | void Remove(Node* node); | 45 | void Remove(Node* node); |
| 46 | void Remove(unsigned int pos); | 46 | void Remove(unsigned int pos); |
| 47 | unsigned int GetNodeIndex(Node* node); | 47 | unsigned int GetNodeIndex(Node* node) const; |
| 48 | 48 | ||
| 49 | private : | 49 | private : |
| 50 | std::vector<Node*> _array; | 50 | std::vector<Node*> _array; |
diff --git a/include/plist/Structure.h b/include/plist/Structure.h index 8e609da..eded8b2 100644 --- a/include/plist/Structure.h +++ b/include/plist/Structure.h | |||
| @@ -34,10 +34,10 @@ class Structure : public Node | |||
| 34 | public : | 34 | public : |
| 35 | virtual ~Structure(); | 35 | virtual ~Structure(); |
| 36 | 36 | ||
| 37 | uint32_t GetSize(); | 37 | uint32_t GetSize() const; |
| 38 | 38 | ||
| 39 | std::string ToXml(); | 39 | std::string ToXml() const; |
| 40 | std::vector<char> ToBin(); | 40 | std::vector<char> ToBin() const; |
| 41 | 41 | ||
| 42 | virtual void Remove(Node* node) = 0; | 42 | virtual void Remove(Node* node) = 0; |
| 43 | 43 | ||
diff --git a/src/Array.cpp b/src/Array.cpp index 3036476..7c38a69 100644 --- a/src/Array.cpp +++ b/src/Array.cpp | |||
| @@ -141,9 +141,9 @@ void Array::Remove(unsigned int pos) | |||
| 141 | _array.erase(it); | 141 | _array.erase(it); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | unsigned int Array::GetNodeIndex(Node* node) | 144 | unsigned int Array::GetNodeIndex(Node* node) const |
| 145 | { | 145 | { |
| 146 | std::vector<Node*>::iterator it = std::find(_array.begin(), _array.end(), node); | 146 | std::vector<Node*>::const_iterator it = std::find(_array.begin(), _array.end(), node); |
| 147 | return std::distance (_array.begin(), it); | 147 | return std::distance (_array.begin(), it); |
| 148 | } | 148 | } |
| 149 | 149 | ||
diff --git a/src/Structure.cpp b/src/Structure.cpp index 18b19ef..70150c2 100644 --- a/src/Structure.cpp +++ b/src/Structure.cpp | |||
| @@ -35,7 +35,7 @@ Structure::~Structure() | |||
| 35 | { | 35 | { |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | uint32_t Structure::GetSize() | 38 | uint32_t Structure::GetSize() const |
| 39 | { | 39 | { |
| 40 | uint32_t size = 0; | 40 | uint32_t size = 0; |
| 41 | plist_type type = plist_get_node_type(_node); | 41 | plist_type type = plist_get_node_type(_node); |
| @@ -50,7 +50,7 @@ uint32_t Structure::GetSize() | |||
| 50 | return size; | 50 | return size; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | std::string Structure::ToXml() | 53 | std::string Structure::ToXml() const |
| 54 | { | 54 | { |
| 55 | char* xml = NULL; | 55 | char* xml = NULL; |
| 56 | uint32_t length = 0; | 56 | uint32_t length = 0; |
| @@ -60,7 +60,7 @@ std::string Structure::ToXml() | |||
| 60 | return ret; | 60 | return ret; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | std::vector<char> Structure::ToBin() | 63 | std::vector<char> Structure::ToBin() const |
| 64 | { | 64 | { |
| 65 | char* bin = NULL; | 65 | char* bin = NULL; |
| 66 | uint32_t length = 0; | 66 | uint32_t length = 0; |
