Function find

Summary

#include <toml/get.hpp>

(1) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > const  & find(const basic_value< C, M, V > &v, const key &ky)

(2) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > & find(basic_value< C, M, V > &v, const key &ky)

(3) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > find(basic_value< C, M, V > &&v, const key &ky)

(4) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > const  & find(const basic_value< C, M, V > &v, const std::size_t idx)

(5) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > & find(basic_value< C, M, V > &v, const std::size_t idx)

(6) template <typename C, template< typename ... > class M, template< typename ... > class V>
    basic_value< C, M, V > find(basic_value< C, M, V > &&v, const std::size_t idx)

(7) template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
    const basic_value< C, M, V > & find(const basic_value< C, M, V > &v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

(8) template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
    basic_value< C, M, V > & find(basic_value< C, M, V > &v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

(9) template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
    basic_value< C, M, V > find(basic_value< C, M, V > &&v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

Function overload

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > const  & find(const basic_value< C, M, V > &v, const key &ky)

Description

No description yet.

Mentioned in

Source

Lines 471-481 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V> const& find(const basic_value<C, M, V>& v, const key& ky)
{
    const auto& tab = v.as_table();
    if(tab.count(ky) == 0)
    {
        detail::throw_key_not_found_error(v, ky);
    }
    return tab.at(ky);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > & find(basic_value< C, M, V > &v, const key &ky)

Description

No description yet.

Mentioned in

Source

Lines 482-492 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V>& find(basic_value<C, M, V>& v, const key& ky)
{
    auto& tab = v.as_table();
    if(tab.count(ky) == 0)
    {
        detail::throw_key_not_found_error(v, ky);
    }
    return tab.at(ky);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > find(basic_value< C, M, V > &&v, const key &ky)

Description

No description yet.

Mentioned in

Source

Lines 493-503 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V> find(basic_value<C, M, V>&& v, const key& ky)
{
    typename basic_value<C, M, V>::table_type tab = std::move(v).as_table();
    if(tab.count(ky) == 0)
    {
        detail::throw_key_not_found_error(v, ky);
    }
    return basic_value<C, M, V>(std::move(tab.at(ky)));
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > const  & find(const basic_value< C, M, V > &v, const std::size_t idx)

Description

No description yet.

Mentioned in

Source

Lines 507-519 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V> const&
find(const basic_value<C, M, V>& v, const std::size_t idx)
{
    const auto& ary = v.as_array();
    if(ary.size() <= idx)
    {
        throw std::out_of_range(detail::format_underline(concat_to_string(
            "index ", idx, " is out of range"), {{v.location(), "in this array"}}));
    }
    return ary.at(idx);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > & find(basic_value< C, M, V > &v, const std::size_t idx)

Description

No description yet.

Mentioned in

Source

Lines 520-531 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V>& find(basic_value<C, M, V>& v, const std::size_t idx)
{
    auto& ary = v.as_array();
    if(ary.size() <= idx)
    {
        throw std::out_of_range(detail::format_underline(concat_to_string(
            "index ", idx, " is out of range"), {{v.location(), "in this array"}}));
    }
    return ary.at(idx);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V>
basic_value< C, M, V > find(basic_value< C, M, V > &&v, const std::size_t idx)

Description

No description yet.

Mentioned in

Source

Lines 532-543 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V>
basic_value<C, M, V> find(basic_value<C, M, V>&& v, const std::size_t idx)
{
    auto& ary = v.as_array();
    if(ary.size() <= idx)
    {
        throw std::out_of_range(detail::format_underline(concat_to_string(
            "index ", idx, " is out of range"), {{v.location(), "in this array"}}));
    }
    return basic_value<C, M, V>(std::move(ary.at(idx)));
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
const basic_value< C, M, V > & find(const basic_value< C, M, V > &v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

Description

No description yet.

Mentioned in

Source

Lines 673-681 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V,
         typename Key1, typename Key2, typename ... Keys>
const basic_value<C, M, V>&
find(const basic_value<C, M, V>& v, Key1&& k1, Key2&& k2, Keys&& ... keys)
{
    return ::toml::find(::toml::find(v, detail::key_cast(k1)),
            detail::key_cast(k2), std::forward<Keys>(keys)...);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
basic_value< C, M, V > & find(basic_value< C, M, V > &v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

Description

No description yet.

Mentioned in

Source

Lines 682-690 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V,
         typename Key1, typename Key2, typename ... Keys>
basic_value<C, M, V>&
find(basic_value<C, M, V>& v, Key1&& k1, Key2&& k2, Keys&& ... keys)
{
    return ::toml::find(::toml::find(v, detail::key_cast(k1)),
            detail::key_cast(k2), std::forward<Keys>(keys)...);
}

Synopsis

#include <toml/get.hpp>

template <typename C, template< typename ... > class M, template< typename ... > class V, typename Key1, typename Key2, typename ... Keys>
basic_value< C, M, V > find(basic_value< C, M, V > &&v, Key1 &&k1, Key2 &&k2, Keys &&... keys)

Description

No description yet.

Mentioned in

Source

Lines 691-699 in toml/get.hpp.

template<typename C,
         template<typename ...> class M, template<typename ...> class V,
         typename Key1, typename Key2, typename ... Keys>
basic_value<C, M, V>
find(basic_value<C, M, V>&& v, Key1&& k1, Key2&& k2, Keys&& ... keys)
{
    return ::toml::find(::toml::find(std::move(v), std::forward<Key1>(k1)),
            detail::key_cast(k2), std::forward<Keys>(keys)...);
}





Add Discussion as Guest

Log in