Passwordfile library
4.0.0
C++ library to read/write passwords from/to encrypted files
|
Instances of the Entry class form a hierarchic data strucutre used to store account information. More...
#include <entry.h>
Public Member Functions | |
virtual | ~Entry () |
Destroys the entry. More... | |
Entry & | operator= (const Entry &other)=delete |
virtual EntryType | type () const =0 |
Returns the type of the entry. More... | |
const std::string & | label () const |
Returns the label. More... | |
void | setLabel (const std::string &label) |
Sets the label. More... | |
void | makeLabelUnique () |
Internally called to make the entry's label unique within the parent. More... | |
NodeEntry * | parent () const |
Returns the parent entry. More... | |
void | setParent (NodeEntry *parent, int index=-1) |
Sets the parent for the entry. More... | |
int | index () const |
Returns the index of the entry within its parent. More... | |
bool | isIndirectChildOf (const NodeEntry *entry) const |
Returns an indication whether the instance is an indirect child of the specified entry. More... | |
std::list< std::string > | path () const |
Returns the path of the entry. More... | |
void | path (std::list< std::string > &res) const |
Stores to path of the entry in the specified list of string. More... | |
virtual void | make (std::ostream &stream) const =0 |
Serializes the entry to the specified stream. More... | |
virtual Entry * | clone () const =0 |
Clones the entry. More... | |
EntryStatistics | computeStatistics () const |
Computes statistics for this entry. More... | |
virtual void | accumulateStatistics (EntryStatistics &stats) const =0 |
Static Public Member Functions | |
static Entry * | parse (std::istream &stream) |
Parses an entry from the specified stream. More... | |
static bool | denotesNodeEntry (byte version) |
static constexpr EntryType | denotedEntryType (byte version) |
Protected Member Functions | |
Entry (const std::string &label=std::string(), NodeEntry *parent=nullptr) | |
Constructs a new entry with the specified label and parent. More... | |
Entry (const Entry &other) | |
Constructs a copy of another entry. More... | |
Protected Attributes | |
std::string | m_extendedData |
Friends | |
class | NodeEntry |
Instances of the Entry class form a hierarchic data strucutre used to store account information.
Entries can be serialized and deserialized using the parse() and make() methods.
|
protected |
|
protected |
|
pure virtual |
Implemented in Io::AccountEntry, and Io::NodeEntry.
|
pure virtual |
Clones the entry.
Implemented in Io::AccountEntry, and Io::NodeEntry.
|
inline |
|
static |
|
inlinestatic |
|
inline |
bool Io::Entry::isIndirectChildOf | ( | const NodeEntry * | entry | ) | const |
|
inline |
|
pure virtual |
Serializes the entry to the specified stream.
Implemented in Io::AccountEntry, and Io::NodeEntry.
void Io::Entry::makeLabelUnique | ( | ) |
Internally called to make the entry's label unique within the parent.
|
inline |
|
static |
Parses an entry from the specified stream.
Throws | ParsingException when a parsing exception occurs. |
std::list< string > Io::Entry::path | ( | ) | const |
void Io::Entry::path | ( | std::list< std::string > & | res | ) | const |
|
inline |
void Io::Entry::setParent | ( | NodeEntry * | parent, |
int | index = -1 |
||
) |
Sets the parent for the entry.
If an index is specified the entry will be inserted as child at this position. If parent is nullptr, the entry will be parentless.
|
pure virtual |
Returns the type of the entry.
Implemented in Io::AccountEntry, and Io::NodeEntry.