userver: userver/formats/common/utils.hpp File Reference
No Matches
utils.hpp File Reference

Detailed Description

formats::common::GetAtPath and formats::common::RemoveAtPath utils for Value and ValueBuilder

Definition in file utils.hpp.

Go to the source code of this file.

#include <cstddef>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <userver/formats/common/meta.hpp>
#include <userver/formats/common/transfer_tag.hpp>
#include <userver/formats/common/type.hpp>
#include <userver/utils/assert.hpp>
+ Include dependency graph for utils.hpp:


namespace  formats
 Value formats representation, parsing and serialization.
namespace  formats::common
 Common utilities for all the formats.


template<typename Value >
std::enable_if_t< common::kIsFormatValue< Value >, Value > formats::common::GetAtPath (Value parent, const std::vector< std::string > &path)
 Get the Value at path in parent.
template<typename ValueBuilder >
std::enable_if_t<!common::kIsFormatValue< ValueBuilder >, ValueBuilder > formats::common::GetAtPath (ValueBuilder &parent, std::vector< std::string > &&path)
 Get the ValueBuilder at path in parent.
template<typename Value >
void formats::common::SetAtPath (typename Value::Builder &parent, std::vector< std::string > &&path, Value new_value)
 Set the new_value along the path in the parent.
template<typename ValueBuilder >
void formats::common::RemoveAtPath (ValueBuilder &parent, std::vector< std::string > &&path)
 Remove the element along the path in the parent.
std::vector< std::string > formats::common::SplitPathString (std::string_view path)
 Split path to vector<std::string> by dots.