libxcks  0.1.0.1
libxcks::XCKSDirStruct::Directory Class Referencefinal

A directory of the directory structure for XCKS files. More...

Inheritance diagram for libxcks::XCKSDirStruct::Directory:
Collaboration diagram for libxcks::XCKSDirStruct::Directory:

Public Member Functions

 Directory ()=delete
 Deleted default constructor. More...
 
 Directory (const Directory &)=delete
 Deleted copy constructor. More...
 
Directoryoperator= (const Directory &)=delete
 Deleted assignment operator. More...
 
 Directory (const string &directoryName, XCKSDirStruct::Element *parentElement, XCKSDirStruct::Element *previousElement)
 Constructor. More...
 
virtual ~Directory ()
 Destructor. More...
 
bool hasChild () const override final
 Does the element have a child? More...
 
bool isAFile () const override final
 Does the element is a file? More...
 
ElementgetChild () const override final
 Gets the child of the element. More...
 
void setChild (Element *newChild) override final
 Sets the child of the element. More...
 
- Public Member Functions inherited from libxcks::XCKSDirStruct::Element
 Element ()=delete
 Deleted default constructor. More...
 
 Element (const Element &)=delete
 Deleted copy constructor. More...
 
Elementoperator= (const Element &)=delete
 Deleted assignment operator. More...
 
 Element (const string &elementName, Element *parentElement, Element *previousElement)
 Constructor. More...
 
virtual ~Element ()
 Destructor. More...
 
virtual bool hasPrevious () const final
 Does the element have a previous element? More...
 
virtual bool hasNext () const final
 Does the element have a following element? More...
 
virtual bool hasParent () const final
 Does the element have a parent? More...
 
virtual bool hasElement (const string &elementName) const final
 Does an element exist with the given name in the current level? More...
 
virtual string getName () const final
 Gets the name of the element. More...
 
virtual ElementgetPrevious () const final
 Gets the previous element of the element. More...
 
virtual void setPrevious (Element *newPrevious) final
 Sets the previous element of the element. More...
 
virtual ElementgetNext () const final
 Gets the following element of the element. More...
 
virtual void setNext (Element *newNext) final
 Sets the following element of the element. More...
 
virtual ElementgetParent () const final
 Gets the parent element of the element. More...
 
virtual void getParent (Element *newParent) final
 Sets the parent element of the element. More...
 
virtual void * getData () const
 Gets the data associated with the element. More...
 
virtual void setData (void *newData)
 Sets the data associated with the element. More...
 
virtual ElementgetElement (const string &elementName, Element **lastElement=nullptr) const final
 Gets the element with the given name in the current level. More...
 
bool addFile (const ArrayString &dirs, const size_t cur, const string &filename, void *data=nullptr)
 Adds a new file in the directory structure. More...
 
XCKSDirStruct::FilegetNextFile () const
 Gets the next file in the directory structure. More...
 

Protected Attributes

Elementchild
 Address of the first child if the element if a directory. More...
 
- Protected Attributes inherited from libxcks::XCKSDirStruct::Element
string name
 The name of the element. More...
 
Elementparent
 Address of the parent. More...
 
Elementprevious
 Address of the previous element at the same level. More...
 
Elementnext
 Address of the next element at the same level. More...
 

Additional Inherited Members

- Protected Member Functions inherited from libxcks::XCKSDirStruct::Element
ElementcreateDirsAndAddFile (const ArrayString &dirs, const size_t cur, const string &filename, void *data=nullptr)
 Creates directories and adds a new file in the directory structure. More...
 
XCKSDirStruct::FilegetNextFileRec () const
 Gets the next file in the directory structure (recursive). More...
 
XCKSDirStruct::FilegetNextFile (const bool calledFromChild) const
 Gets the next file in the directory structure. More...
 

Detailed Description

A directory of the directory structure for XCKS files.

Definition at line 336 of file xcksfilewriter.cpp.

Constructor & Destructor Documentation

◆ Directory() [1/3]

libxcks::XCKSDirStruct::Directory::Directory ( )
delete

Deleted default constructor.

◆ Directory() [2/3]

libxcks::XCKSDirStruct::Directory::Directory ( const Directory )
delete

Deleted copy constructor.

◆ Directory() [3/3]

libxcks::XCKSDirStruct::Directory::Directory ( const string &  fileName,
XCKSDirStruct::Element parentElement,
XCKSDirStruct::Element previousElement 
)

Constructor.

Parameters
fileNameName of the file.
parentElementParent of the file.
previousElementAddress of the previous element (can be nullptr if is the first element of the level).

Definition at line 887 of file xcksfilewriter.cpp.

◆ ~Directory()

virtual libxcks::XCKSDirStruct::Directory::~Directory ( )
inlinevirtual

Destructor.

Definition at line 355 of file xcksfilewriter.cpp.

Member Function Documentation

◆ getChild()

Element* libxcks::XCKSDirStruct::Directory::getChild ( ) const
inlinefinaloverridevirtual

Gets the child of the element.

Returns
The child of the element or nullptr if the element hasn't a child.

Reimplemented from libxcks::XCKSDirStruct::Element.

Definition at line 377 of file xcksfilewriter.cpp.

◆ hasChild()

bool libxcks::XCKSDirStruct::Directory::hasChild ( ) const
inlinefinaloverridevirtual

Does the element have a child?

Returns
true if the element has a child, false otherwise.

Reimplemented from libxcks::XCKSDirStruct::Element.

Definition at line 362 of file xcksfilewriter.cpp.

◆ isAFile()

bool libxcks::XCKSDirStruct::Directory::isAFile ( ) const
inlinefinaloverridevirtual

Does the element is a file?

Returns
true if the element is a file, false otherwise.

Implements libxcks::XCKSDirStruct::Element.

Definition at line 369 of file xcksfilewriter.cpp.

◆ operator=()

Directory& libxcks::XCKSDirStruct::Directory::operator= ( const Directory )
delete

Deleted assignment operator.

◆ setChild()

void libxcks::XCKSDirStruct::Directory::setChild ( Element newChild)
inlinefinaloverridevirtual

Sets the child of the element.

Parameters
newChildThe new child of the element.

Reimplemented from libxcks::XCKSDirStruct::Element.

Definition at line 384 of file xcksfilewriter.cpp.

Member Data Documentation

◆ child

Element* libxcks::XCKSDirStruct::Directory::child
protected

Address of the first child if the element if a directory.

Definition at line 339 of file xcksfilewriter.cpp.


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