Passwordfile library  3.1.2
C++ library to read/write passwords from/to encrypted files
Public Member Functions | Friends | List of all members
Io::NodeEntry Class Reference

The NodeEntry class acts as parent for other entries. More...

#include <entry.h>

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

Public Member Functions

 NodeEntry ()
 Constructs a new node entry. More...
 
 NodeEntry (const std::string &label, NodeEntry *parent=nullptr)
 Constructs a new node entry with the specified label and parent. More...
 
 NodeEntry (std::istream &stream)
 Constructs a new node entry which is deserialized from the specified stream. More...
 
 NodeEntry (const NodeEntry &other)
 Constructs a copy of the another entry. More...
 
 ~NodeEntry ()
 Destroys the entry. More...
 
virtual EntryType type () const
 Returns the type of the entry. More...
 
const std::vector< Entry * > & children () const
 
void deleteChildren (int begin, int end)
 Deletes children from the node entry. More...
 
void replaceChild (size_t at, Entry *newChild)
 Replaces the child at the specified index with the specified newChild. More...
 
EntryentryByPath (std::list< std::string > &path, bool includeThis=true, EntryType *creationType=nullptr)
 Returns an entry specified by the provided path. More...
 
bool isExpandedByDefault () const
 
void setExpandedByDefault (bool expandedByDefault)
 
virtual void make (std::ostream &stream) const
 Serializes the entry to the specified stream. More...
 
virtual NodeEntryclone () const
 Clones the entry. More...
 
- Public Member Functions inherited from Io::Entry
virtual ~Entry ()
 Destroys the entry. More...
 
Entryoperator= (const Entry &other)=delete
 
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...
 

Friends

class Entry
 

Additional Inherited Members

- Static Public Member Functions inherited from Io::Entry
static Entryparse (std::istream &stream)
 Parses an entry from the specified stream. More...
 
static bool denotesNodeEntry (byte version)
 
- Protected Member Functions inherited from Io::Entry
 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 inherited from Io::Entry
std::string m_extendedData
 

Detailed Description

The NodeEntry class acts as parent for other entries.

Definition at line 97 of file entry.h.

Constructor & Destructor Documentation

Io::NodeEntry::NodeEntry ( )

Constructs a new node entry.

Definition at line 195 of file entry.cpp.

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

Constructs a new node entry with the specified label and parent.

Definition at line 203 of file entry.cpp.

Io::NodeEntry::NodeEntry ( std::istream &  stream)

Constructs a new node entry which is deserialized from the specified stream.

Definition at line 211 of file entry.cpp.

Io::NodeEntry::NodeEntry ( const NodeEntry other)

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 245 of file entry.cpp.

Io::NodeEntry::~NodeEntry ( )

Destroys the entry.

Definition at line 259 of file entry.cpp.

Member Function Documentation

const std::vector< Entry * > & Io::NodeEntry::children ( ) const
inline

Definition at line 127 of file entry.h.

NodeEntry * Io::NodeEntry::clone ( ) const
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.

Implements Io::Entry.

Definition at line 365 of file entry.cpp.

void Io::NodeEntry::deleteChildren ( int  begin,
int  end 
)

Deletes children from the node entry.

Parameters
beginSpecifies the index of the first children to delete.
endSpecifies the index after the last children to delete.

Definition at line 272 of file entry.cpp.

Entry * Io::NodeEntry::entryByPath ( std::list< std::string > &  path,
bool  includeThis = true,
EntryType creationType = nullptr 
)

Returns an entry specified by the provided path.

Parameters
pathSpecifies the path of the entry to be returned.
includeThisSpecifies whether the current instance should be included.
creationTypeSpecifies 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).
Returns
Returns the entry if found (or created); otherwise nullptr is returned.

Definition at line 303 of file entry.cpp.

bool Io::NodeEntry::isExpandedByDefault ( ) const
inline

Definition at line 132 of file entry.h.

void Io::NodeEntry::make ( std::ostream &  stream) const
virtual

Serializes the entry to the specified stream.

Implements Io::Entry.

Definition at line 345 of file entry.cpp.

void Io::NodeEntry::replaceChild ( size_t  at,
Entry newChild 
)

Replaces the child at the specified index with the specified newChild.

Definition at line 286 of file entry.cpp.

void Io::NodeEntry::setExpandedByDefault ( bool  expandedByDefault)
inline

Definition at line 137 of file entry.h.

EntryType Io::NodeEntry::type ( ) const
inlinevirtual

Returns the type of the entry.

Implements Io::Entry.

Definition at line 122 of file entry.h.

Friends And Related Function Documentation

friend class Entry
friend

Definition at line 99 of file entry.h.


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