Passwordfile library 5.0.8
C++ library to read/write passwords from/to encrypted files
|
The NodeEntry class acts as parent for other entries. More...
#include <entry.h>
Public Member Functions | |
NodeEntry () | |
Constructs a new node entry. | |
NodeEntry (const std::string &label, NodeEntry *parent=nullptr) | |
Constructs a new node entry with the specified label and parent. | |
NodeEntry (std::istream &stream) | |
Constructs a new node entry which is deserialized from the specified stream. | |
NodeEntry (const NodeEntry &other) | |
Constructs a copy of the another entry. | |
~NodeEntry () override | |
Destroys the entry. | |
EntryType | type () const override |
Returns the type of the entry. | |
const std::vector< Entry * > & | children () const |
void | deleteChildren (int begin, int end) |
Deletes children from the node entry. | |
void | replaceChild (std::size_t at, Entry *newChild) |
Replaces the child at the specified index with the specified newChild. | |
Entry * | entryByPath (std::list< std::string > &path, bool includeThis=true, const EntryType *creationType=nullptr) |
Returns an entry specified by the provided path. | |
bool | isExpandedByDefault () const |
void | setExpandedByDefault (bool expandedByDefault) |
void | make (std::ostream &stream) const override |
Serializes the entry to the specified stream. | |
NodeEntry * | clone () const override |
Clones the entry. | |
void | accumulateStatistics (EntryStatistics &stats) const override |
Accumulates the statistics for this node entry and its children. | |
![]() | |
virtual | ~Entry () |
Destroys the entry. | |
Entry & | operator= (const Entry &other)=delete |
virtual EntryType | type () const =0 |
Returns the type of the entry. | |
const std::string & | label () const |
Returns the label. | |
void | setLabel (const std::string &label) |
Sets the label. | |
void | makeLabelUnique () |
Internally called to make the entry's label unique within the parent. | |
NodeEntry * | parent () const |
Returns the parent entry. | |
void | setParent (NodeEntry *parent, int index=-1) |
Sets the parent for the entry. | |
int | index () const |
Returns the index of the entry within its parent. | |
bool | isIndirectChildOf (const NodeEntry *entry) const |
Returns an indication whether the instance is an indirect child of the specified entry. | |
std::list< std::string > | path () const |
Returns the path of the entry. | |
void | path (std::list< std::string > &res) const |
Stores to path of the entry in the specified list of string. | |
virtual void | make (std::ostream &stream) const =0 |
Serializes the entry to the specified stream. | |
virtual Entry * | clone () const =0 |
Clones the entry. | |
EntryStatistics | computeStatistics () const |
Computes statistics for this entry. | |
virtual void | accumulateStatistics (EntryStatistics &stats) const =0 |
Friends | |
class | Entry |
Additional Inherited Members | |
![]() | |
static Entry * | parse (std::istream &stream) |
Parses an entry from the specified stream. | |
static bool | denotesNodeEntry (std::uint8_t version) |
static constexpr EntryType | denotedEntryType (std::uint8_t version) |
![]() | |
Entry (const std::string &label=std::string(), NodeEntry *parent=nullptr) | |
Constructs a new entry with the specified label and parent. | |
Entry (const Entry &other) | |
Constructs a copy of another entry. | |
![]() | |
std::string | m_extendedData |
Io::NodeEntry::NodeEntry | ( | const std::string & | label, |
NodeEntry * | parent = nullptr |
||
) |
Io::NodeEntry::NodeEntry | ( | std::istream & | stream | ) |
Io::NodeEntry::NodeEntry | ( | const NodeEntry & | other | ) |
|
override |
|
overridevirtual |
|
inline |
|
overridevirtual |
void Io::NodeEntry::deleteChildren | ( | int | begin, |
int | end | ||
) |
Entry * Io::NodeEntry::entryByPath | ( | std::list< std::string > & | path, |
bool | includeThis = true , |
||
const EntryType * | creationType = nullptr |
||
) |
Returns an entry specified by the provided path.
path | Specifies the path of the entry to be returned. |
includeThis | Specifies whether the current instance should be included. |
creationType | Specifies a pointer which dereferenced value determines what kind of entry should be created if the entry specified by the provided path does not exist. The parent of the entry to be created must exist. Specify nullptr if no entries should be created (default). |
|
overridevirtual |
void Io::NodeEntry::replaceChild | ( | std::size_t | at, |
Entry * | newChild | ||
) |
Replaces the child at the specified index with the specified newChild.
|
inline |
|
inlineoverridevirtual |