GnuCash  5.6-150-g038405b370+
Data Structures | Public Types | Public Member Functions | Friends
KvpFrameImpl Struct Reference

Implements KvpFrame. More...

#include <kvp-frame.hpp>

Data Structures

class  cstring_comparer
 

Public Types

using map_type = std::map< const char *, KvpValue *, cstring_comparer >
 

Public Member Functions

 KvpFrameImpl (const KvpFrameImpl &) noexcept
 Performs a deep copy.
 
 ~KvpFrameImpl () noexcept
 Perform a deep delete.
 
KvpValue * set (Path path, KvpValue *newvalue) noexcept
 Set the value with the key in the immediate frame, replacing and returning the old value if it exists or nullptr if it doesn't. More...
 
KvpValue * set_path (Path path, KvpValue *newvalue) noexcept
 Set the value with the key in a subframe following the keys in path, replacing and returning the old value if it exists or nullptr if it doesn't. More...
 
std::string to_string () const noexcept
 Make a string representation of the frame. More...
 
std::string to_string (std::string const &) const noexcept
 Make a string representation of the frame with the specified string prefixed to every item in the frame. More...
 
std::vector< std::string > get_keys () const noexcept
 Report the keys in the immediate frame. More...
 
KvpValue * get_slot (Path keys) noexcept
 Get the value for the tail of the path or nullptr if it doesn't exist. More...
 
template<typename func_type , typename data_type >
void for_each_slot_temp (func_type const &, data_type &) const noexcept
 The function should be of the form: <anything> func (char const *, KvpValue *, data_type &); Do not pass nullptr as the function.
 
template<typename func_type >
void for_each_slot_temp (func_type const &) const noexcept
 
template<typename func_type , typename data_type >
void for_each_slot_prefix (std::string const &prefix, func_type const &, data_type &) const noexcept
 Like for_each_slot, but doesn't traverse nested values. More...
 
template<typename func_type >
void for_each_slot_prefix (std::string const &prefix, func_type const &) const noexcept
 
std::vector< KvpEntry > flatten_kvp (void) const noexcept
 Returns all keys and values of this frame recursively, flattening the frame-containing values.
 
bool empty () const noexcept
 Test for emptiness. More...
 
map_type::iterator begin ()
 
map_type::iterator end ()
 

Friends

int compare (const KvpFrameImpl &, const KvpFrameImpl &) noexcept
 If the first KvpFrameImpl has an item that the second does not, 1 is returned. More...
 

Detailed Description

Implements KvpFrame.

It's a struct because QofInstance needs to use the typename to declare a KvpFrame* member, and QofInstance's API is C until its children are all rewritten in C++.

N.B.** Writes to KvpFrames must** be wrapped in BeginEdit and Commit for the containing QofInstance and the QofInstance must be marked dirty. This is not** done by the KvpFrame API. In general Kvp items should be accessed using either QofInstance or QofBook methods in order to ensure that this is done.

Definition at line 109 of file kvp-frame.hpp.


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