avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
av::Dictionary::Entry Class Reference

Dictionary key and value holder and accessor.

#include <dictionary.h>

Public Member Functions

const char * key () const noexcept
 key - item key accessor
const char * value () const noexcept
 value - item value accessor
 operator bool () const
 operator bool - converts holder to bool returns true if entry valid, false otherwise
bool isNull () const
 isNull - checks that entry invalid (null)
Entry function-like value set inteface

set - change value of the current item

Parameters
valuenew value
flagsaccess flags, FlagDontStrdupVal only accepted, other flags ignored
void set (const char *value, int flags=0) noexcept
 Change the value of this entry.
void set (const std::string &value, int flags=0) noexcept
 Change the value of this entry.
Entry operator[]-like value set inteface

Helper operators.

Syntax shugar.

Parameters
valuenew item value. Always strduped. Use set() to be more flexibility.
Returns
referenct to this
Entry & operator= (const char *value) noexcept
 Assign a value through the entry holder.
Entry & operator= (const std::string &value) noexcept
 Assign a value through the entry holder.

Friends

template<bool>
class DictionaryIterator
class Dictionary
bool operator== (const Entry &lhs, const Entry &rhs)
 Compare two entries.
bool operator!= (const Entry &lhs, const Entry &rhs)
 Compare two entries.

Member Function Documentation

◆ isNull()

bool av::Dictionary::Entry::isNull ( ) const
Returns
true if entry null, false otherwise

◆ key()

const char * av::Dictionary::Entry::key ( ) const
noexcept
Returns
current item key, or null if entry null

◆ operator=() [1/2]

Entry & av::Dictionary::Entry::operator= ( const char * value)
noexcept
Parameters
valuethe new value; it is copied
Returns
this entry holder

◆ operator=() [2/2]

Entry & av::Dictionary::Entry::operator= ( const std::string & value)
noexcept
Parameters
valuethe new value; it is copied
Returns
this entry holder

◆ set() [1/2]

void av::Dictionary::Entry::set ( const char * value,
int flags = 0 )
noexcept
Parameters
valuethe new value
flagsAV_DICT_DONT_STRDUP_VAL is the only flag that applies here

◆ set() [2/2]

void av::Dictionary::Entry::set ( const std::string & value,
int flags = 0 )
noexcept
Parameters
valuethe new value
flagsAV_DICT_DONT_STRDUP_VAL is the only flag that applies here

◆ value()

const char * av::Dictionary::Entry::value ( ) const
noexcept
Returns
current item value or null if entry null

◆ operator!=

bool operator!= ( const Entry & lhs,
const Entry & rhs )
friend
Parameters
lhsthe left entry
rhsthe right entry
Returns
true when they refer to different elements

◆ operator==

bool operator== ( const Entry & lhs,
const Entry & rhs )
friend
Parameters
lhsthe left entry
rhsthe right entry
Returns
true when both refer to the same dictionary element

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