diff options
Diffstat (limited to 'src/Array.cpp')
| -rw-r--r-- | src/Array.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Array.cpp b/src/Array.cpp index bdd26e1..a847ae2 100644 --- a/src/Array.cpp +++ b/src/Array.cpp | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #include <plist/Array.h> | 22 | #include <plist/Array.h> |
| 23 | #include <plist/Utils.h> | 23 | #include <plist/Utils.h> |
| 24 | 24 | ||
| 25 | #include <algorithm> | ||
| 26 | |||
| 25 | namespace PList | 27 | namespace PList |
| 26 | { | 28 | { |
| 27 | 29 | ||
| @@ -140,4 +142,10 @@ void Array::Remove(unsigned int pos) | |||
| 140 | _array.erase(it); | 142 | _array.erase(it); |
| 141 | } | 143 | } |
| 142 | 144 | ||
| 145 | unsigned int Array::GetNodeIndex(Node* node) | ||
| 146 | { | ||
| 147 | std::vector<Node*>::iterator it = std::find(_array.begin(), _array.end(), node); | ||
| 148 | return std::distance (_array.begin(), it); | ||
| 149 | } | ||
| 150 | |||
| 143 | }; | 151 | }; |
