summaryrefslogtreecommitdiffstats
path: root/include/plist/Array.h
diff options
context:
space:
mode:
authorGravatar guyingzhao2025-04-06 12:18:23 +0200
committerGravatar Nikias Bassen2025-04-06 12:18:23 +0200
commite6f3c6c62111b37cc97db2d61a1c765695ee401a (patch)
treeea39e49b6587443d070a0edeccef6c8dffe35c8e /include/plist/Array.h
parented8a73301b844bf5f7efd9cd437c9c0765a49a88 (diff)
downloadlibplist-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.h17
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 :
52 const_iterator End() const; 52 const_iterator End() const;
53 const_iterator end() const; 53 const_iterator end() const;
54 size_t size() const; 54 size_t size() const;
55 void Append(Node* node); 55 void Append(const Node& node);
56 void Insert(Node* node, unsigned int pos); 56 void Append(const Node* node);
57 void Insert(const Node& node, unsigned int pos);
58 void Insert(const Node* node, unsigned int pos);
57 void Remove(Node* node); 59 void Remove(Node* node);
58 void Remove(unsigned int pos); 60 void Remove(unsigned int pos);
59 unsigned int GetNodeIndex(Node* node) const; 61 unsigned int GetNodeIndex(const Node& node) const;
60 template <typename T> 62 unsigned int GetNodeIndex(const Node* node) const;
61 T* at(unsigned int index) 63 template <typename T> T* at(unsigned int index) {
62 {
63 return (T*)(_array.at(index)); 64 return (T*)(_array.at(index));
64 } 65 }
65 template <typename T> 66 template <typename T> T* At(unsigned int index) {
66 T* At(unsigned int index)
67 {
68 return (T*)(_array.at(index)); 67 return (T*)(_array.at(index));
69 } 68 }
70 69