Core: ValueMap::Find, FindNext

git-svn-id: svn://ultimatepp.org/upp/trunk@8935 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-09-15 11:13:30 +00:00
parent f676aeec94
commit aea6d624fa
2 changed files with 13 additions and 0 deletions

View file

@ -357,6 +357,8 @@ public:
bool IsEmpty() const { return data->value.IsEmpty(); }
const Value& GetKey(int i) const { return data->key[i]; }
const Value& GetValue(int i) const { return data->value[i]; }
int Find(const Value& key) const { return data ? data->key.Find(key) : -1; }
int FindNext(int ii) const { return data ? data->key.FindNext(ii) : -1; }
void Add(const Value& key, const Value& value);
void Add(const String& key, const Value& value) { Add(Value(key), value); }

View file

@ -135,6 +135,17 @@ etKey]([@(0.0.255) int]_[*@3 i])_[@(0.0.255) const]&]
[s2; Returns value at index [%-*@3 i].&]
[s3; &]
[s4;%- &]
[s5;:Upp`:`:ValueMap`:`:Find`(const Upp`:`:Value`&`)const:%- [@(0.0.255) int]_[* Find]([@(0.0.255) c
onst]_[_^Upp`:`:Value^ Value][@(0.0.255) `&]_[*@3 key])_[@(0.0.255) const]&]
[s2; Returns the index of first [%-*@3 key] or `-1 if not present.&]
[s3; &]
[s4;%- &]
[s5;:Upp`:`:ValueMap`:`:FindNext`(int`)const:%- [@(0.0.255) int]_[* FindNext]([@(0.0.255) i
nt]_[*@3 ii])_[@(0.0.255) const]&]
[s2; Returns the index of next key with the same value as key at
index [%-*@3 ii] or `-1 if not present.&]
[s3; &]
[s4;%- &]
[s5;:ValueMap`:`:Add`(const Value`&`,const Value`&`):%- [@(0.0.255) void]_[* Add]([@(0.0.255) c
onst]_[_^Value^ Value][@(0.0.255) `&]_[*@3 key], [@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&
]_[*@3 value])&]