Passwordfile library  3.1.3
C++ library to read/write passwords from/to encrypted files
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Io::Entry Class Referenceabstract

Instances of the Entry class form a hierarchic data strucutre used to store account information. More...

#include <entry.h>

Inheritance diagram for Io::Entry:
[legend]
Collaboration diagram for Io::Entry:
[legend]

Public Member Functions

virtual ~Entry ()
 Destroys the entry. More...
 
Entryoperator= (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 label unique. More...
 
NodeEntryparent () 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 (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 Entryclone () const =0
 Clones the entry. More...
 

Static Public Member Functions

static Entryparse (std::istream &stream)
 Parses an entry from the specified stream. More...
 
static bool denotesNodeEntry (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 the another entry. More...
 

Protected Attributes

std::string m_extendedData
 

Friends

class NodeEntry
 

Detailed Description

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.

Definition at line 26 of file entry.h.

Constructor & Destructor Documentation

§ ~Entry()

Io::Entry::~Entry ( )
virtual

Destroys the entry.

Definition at line 54 of file entry.cpp.

§ Entry() [1/2]

Io::Entry::Entry ( const std::string &  label = std::string(),
NodeEntry parent = nullptr 
)
protected

Constructs a new entry with the specified label and parent.

Definition at line 32 of file entry.cpp.

§ Entry() [2/2]

Io::Entry::Entry ( const Entry other)
protected

Constructs a copy of the another entry.

Remarks
The copy will be parentless and thus not be embedded in the hierarchy of other. Child entries will be copied as well.

Definition at line 45 of file entry.cpp.

Member Function Documentation

§ clone()

Io::Entry::clone ( ) const
pure virtual

Clones the entry.

Remarks
The copy will be parentless and thus not be embedded in the hierarchy of other. Child entries will be copied as well.

Implemented in Io::AccountEntry, and Io::NodeEntry.

§ denotesNodeEntry()

bool Io::Entry::denotesNodeEntry ( byte  version)
inlinestatic

Definition at line 142 of file entry.h.

§ index()

int Io::Entry::index ( ) const
inline

Returns the index of the entry within its parent.

Returns -1 for parentless entries.

Definition at line 92 of file entry.h.

§ isIndirectChildOf()

bool Io::Entry::isIndirectChildOf ( NodeEntry entry) const

Returns an indication whether the instance is an indirect child of the specified entry.

Definition at line 122 of file entry.cpp.

§ label()

const std::string & Io::Entry::label ( ) const
inline

Returns the label.

Definition at line 64 of file entry.h.

§ make()

Io::Entry::make ( std::ostream &  stream) const
pure virtual

Serializes the entry to the specified stream.

Implemented in Io::AccountEntry, and Io::NodeEntry.

§ makeLabelUnique()

void Io::Entry::makeLabelUnique ( )

Internally called to make the label unique.

See also
setLabel()

Definition at line 63 of file entry.cpp.

§ operator=()

Entry& Io::Entry::operator= ( const Entry other)
delete

§ parent()

NodeEntry * Io::Entry::parent ( ) const
inline

Returns the parent entry.

Remarks
Returns nullptr for top-level entries.

Definition at line 84 of file entry.h.

§ parse()

Entry * Io::Entry::parse ( std::istream &  stream)
static

Parses an entry from the specified stream.

Exceptions
ThrowsParsingException when a parsing exception occurs.

Definition at line 160 of file entry.cpp.

§ path() [1/2]

std::list< string > Io::Entry::path ( ) const

Returns the path of the entry.

Definition at line 138 of file entry.cpp.

§ path() [2/2]

void Io::Entry::path ( std::list< std::string > &  res) const

Stores to path of the entry in the specified list of string.

Definition at line 148 of file entry.cpp.

§ setLabel()

void Io::Entry::setLabel ( const std::string &  label)
inline

Sets the label.

Remarks
The label might be modified to ensure that each child entry within a certain parent has a unique label.

Definition at line 74 of file entry.h.

§ setParent()

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.

Definition at line 91 of file entry.cpp.

§ type()

Io::Entry::type ( ) const
pure virtual

Returns the type of the entry.

Implemented in Io::AccountEntry, and Io::NodeEntry.

Friends And Related Function Documentation

§ NodeEntry

friend class NodeEntry
friend

Definition at line 28 of file entry.h.

Member Data Documentation

§ m_extendedData

std::string Io::Entry::m_extendedData
protected

Definition at line 57 of file entry.h.


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