diff options
author | 2025-04-06 12:18:23 +0200 | |
---|---|---|
committer | 2025-04-06 12:18:23 +0200 | |
commit | e6f3c6c62111b37cc97db2d61a1c765695ee401a (patch) | |
tree | ea39e49b6587443d070a0edeccef6c8dffe35c8e /include/plist/Array.h | |
parent | ed8a73301b844bf5f7efd9cd437c9c0765a49a88 (diff) | |
download | libplist-e6f3c6c62111b37cc97db2d61a1c765695ee401a.tar.gz libplist-e6f3c6c62111b37cc97db2d61a1c765695ee401a.tar.bz2 |
C++: Array: Add const Node& variants to Append, Insert
Diffstat (limited to 'include/plist/Array.h')
-rw-r--r-- | include/plist/Array.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/plist/Array.h b/include/plist/Array.h index 34ddd6f..949fa4c 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h @@ -52,19 +52,18 @@ public : const_iterator End() const; const_iterator end() const; size_t size() const; - void Append(Node* node); - void Insert(Node* node, unsigned int pos); + void Append(const Node& node); + void Append(const Node* node); + void Insert(const Node& node, unsigned int pos); + void Insert(const Node* node, unsigned int pos); void Remove(Node* node); void Remove(unsigned int pos); - unsigned int GetNodeIndex(Node* node) const; - template <typename T> - T* at(unsigned int index) - { + unsigned int GetNodeIndex(const Node& node) const; + unsigned int GetNodeIndex(const Node* node) const; + template <typename T> T* at(unsigned int index) { return (T*)(_array.at(index)); } - template <typename T> - T* At(unsigned int index) - { + template <typename T> T* At(unsigned int index) { return (T*)(_array.at(index)); } |