mirror of
https://github.com/libimobiledevice/libplist
synced 2026-06-08 15:29:34 +00:00
Add GetNodeIdex and GetNodeKey methods.
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
#include <plist/Array.h>
|
||||
#include <plist/Utils.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace PList
|
||||
{
|
||||
|
||||
@@ -140,4 +142,10 @@ void Array::Remove(unsigned int pos)
|
||||
_array.erase(it);
|
||||
}
|
||||
|
||||
unsigned int Array::GetNodeIndex(Node* node)
|
||||
{
|
||||
std::vector<Node*>::iterator it = std::find(_array.begin(), _array.end(), node);
|
||||
return std::distance (_array.begin(), it);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user