1 #ifndef PASSWORD_FILE_IO_ENTRY_H 2 #define PASSWORD_FILE_IO_ENTRY_H 6 #include <c++utilities/conversion/types.h> 32 const std::string &label()
const;
33 void setLabel(
const std::string &label);
34 void makeLabelUnique();
36 void setParent(
NodeEntry *parent,
int index = -1);
38 bool isIndirectChildOf(
NodeEntry *entry)
const;
39 std::list<std::string> path()
const;
40 void path(std::list<std::string> &res)
const;
41 virtual void make(std::ostream &stream)
const = 0;
42 virtual Entry *clone()
const = 0;
43 static Entry *parse(std::istream &stream);
44 static bool denotesNodeEntry(byte version);
45 static constexpr
EntryType denotedEntryType(byte version);
48 Entry(
const std::string &label = std::string(),
NodeEntry *parent =
nullptr);
107 const std::vector<Entry *> &children()
const;
108 void deleteChildren(
int begin,
int end);
109 void replaceChild(std::size_t at,
Entry *newChild);
110 Entry *entryByPath(std::list<std::string> &path,
bool includeThis =
true,
EntryType *creationType =
nullptr);
111 bool isExpandedByDefault()
const;
112 void setExpandedByDefault(
bool expandedByDefault);
113 virtual void make(std::ostream &stream)
const;
117 std::vector<Entry *> m_children;
118 bool m_expandedByDefault;
133 return m_expandedByDefault;
138 m_expandedByDefault = expandedByDefault;
143 return (version & 0x80) == 0;
160 const std::vector<Field> &fields()
const;
161 std::vector<Field> &fields();
162 virtual void make(std::ostream &stream)
const;
166 std::vector<Field> m_fields;
185 #endif // PASSWORD_FILE_IO_ENTRY_H
NodeEntry * parent() const
Returns the parent entry.
The NodeEntry class acts as parent for other entries.
const std::string & label() const
Returns the label.
void setLabel(const std::string &label)
Sets the label.
static constexpr EntryType denotedEntryType(byte version)
bool isExpandedByDefault() const
virtual EntryType type() const
Returns the type of the entry.
Contains all IO related classes.
int index() const
Returns the index of the entry within its parent.
std::string m_extendedData
The exception that is thrown when a parsing error occurs.
#define PASSWORD_FILE_EXPORT
Marks the symbol to be exported by the passwordfile library.
static bool denotesNodeEntry(byte version)
const std::vector< Entry * > & children() const
void makeLabelUnique()
Internally called to make the entry's label unique within the parent.
const std::vector< Field > & fields() const
EntryType
Specifies the entry type.
void setExpandedByDefault(bool expandedByDefault)
virtual EntryType type() const
Returns the type of the entry.
Instances of the Entry class form a hierarchic data strucutre used to store account information...