forked from premiere/premiere-libtorrent
added dict_find_string to lazy_entry
This commit is contained in:
parent
2ab80ddc3a
commit
3b35b2c2e3
|
@ -124,6 +124,7 @@ namespace libtorrent
|
|||
size_type dict_find_int_value(char const* name, size_type default_val = 0) const;
|
||||
lazy_entry const* dict_find_dict(char const* name) const;
|
||||
lazy_entry const* dict_find_list(char const* name) const;
|
||||
lazy_entry const* dict_find_string(char const* name) const;
|
||||
|
||||
std::pair<std::string, lazy_entry const*> dict_at(int i) const
|
||||
{
|
||||
|
|
|
@ -260,6 +260,13 @@ namespace libtorrent
|
|||
return e->string_value();
|
||||
}
|
||||
|
||||
lazy_entry const* lazy_entry::dict_find_string(char const* name) const
|
||||
{
|
||||
lazy_entry const* e = dict_find(name);
|
||||
if (e == 0 || e->type() != lazy_entry::string_t) return 0;
|
||||
return e;
|
||||
}
|
||||
|
||||
size_type lazy_entry::dict_find_int_value(char const* name, size_type default_val) const
|
||||
{
|
||||
lazy_entry const* e = dict_find(name);
|
||||
|
|
Loading…
Reference in New Issue