C++ Server-Side SDK
LaunchDarkly SDK
Classes | Public Member Functions | Friends | List of all members
launchdarkly::Value::Object Class Reference

#include <value.hpp>

Classes

struct  Iterator
 

Public Member Functions

 Object (std::map< std::string, Value > map)
 
 Object (std::initializer_list< std::pair< std::string, Value >> values)
 
Value const & operator[] (std::string const &key) const
 
std::size_t Size () const
 
std::size_t Count (std::string const &key) const
 
Iterator begin () const
 
Iterator end () const
 
Iterator Find (std::string const &key) const
 

Friends

std::ostream & operator<< (std::ostream &out, Object const &obj)
 

Detailed Description

Object type for values. Provides const iteration and indexing.

Constructor & Destructor Documentation

◆ Object()

launchdarkly::Value::Object::Object ( std::map< std::string, Value map)
inline

Create an Object from a map of Values.

Parameters
mapThe map to base the object on.

Member Function Documentation

◆ Count()

std::size_t launchdarkly::Value::Object::Count ( std::string const &  key) const

Get the number of items with the given key. Will be 1 or 0.

Parameters
keyThe key to get a count for.
Returns
The count of items with the given key.

◆ Find()

Value::Object::Iterator launchdarkly::Value::Object::Find ( std::string const &  key) const

Find a Value by key. Operates like find on a std::map.

Parameters
keyThe key to find a value for.
Returns
The value, or the end iterator.

◆ Size()

std::size_t launchdarkly::Value::Object::Size ( ) const

The number of items in the Object.

Returns
The number of items in the Object.

The documentation for this class was generated from the following files: