Yate
Public Member Functions | Protected Attributes | List of all members
ClientDir Class Reference

A directory. More...

#include <yatecbase.h>

Inheritance diagram for ClientDir:
ClientFileItem GenObject

Public Member Functions

 ClientDir (const char *name)
 
 ClientDir (const ClientDir &other)
 
ObjListchildren ()
 
bool updated () const
 
void updated (bool on)
 
bool treeUpdated () const
 
ClientDiraddDir (const String &name)
 
ClientDiraddDirPath (const String &path, const char *sep="/")
 
void copyChildren (const ObjList &list)
 
void addChildren (ObjList &list)
 
bool addChild (ClientFileItem *item)
 
ClientFileItemfindChild (const String &path, const char *sep="/")
 
ClientFileItemfindChildName (const String &name)
 
virtual ClientDirdirectory ()
 
- Public Member Functions inherited from ClientFileItem
 ClientFileItem (const char *name)
 
const Stringname () const
 
virtual ClientFilefile ()
 
virtual const StringtoString () const
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Protected Attributes

ObjList m_children
 
bool m_updated
 

Additional Inherited Members

- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

A directory.

This class holds directory info

Constructor & Destructor Documentation

ClientDir ( const char *  name)
inline

Constructor

Parameters
nameDirectory name
ClientDir ( const ClientDir other)
inline

Copy constructor. Copy known children types

Parameters
otherSource object

References ClientDir::copyChildren().

Member Function Documentation

bool addChild ( ClientFileItem item)

Add an item. Remove another item with the same name if exists

Parameters
itemItem to add
Returns
True on success
void addChildren ( ObjList list)

Add a list of children, consume the objects

Parameters
listList of ClientFileItem objects to add
ClientDir* addDir ( const String name)

Build and add a sub-directory if not have one already Replace an existing file with the same name

Parameters
nameDirectory name
Returns
ClientDir pointer or 0 on failure
ClientDir* addDirPath ( const String path,
const char *  sep = "/" 
)

Build sub directories from path

Parameters
pathDirectory path
sepPath separator
Returns
ClientDir pointer or 0 on failure
ObjList& children ( )
inline

Retrieve the children list

Returns
Children list
void copyChildren ( const ObjList list)

Add a copy of known children types

Parameters
listList of ClientFileItem objects to copy

Referenced by ClientDir::ClientDir().

virtual ClientDir* directory ( )
inlinevirtual

Check if this item is a directory

Returns
ClientDir pointer

Reimplemented from ClientFileItem.

ClientFileItem* findChild ( const String path,
const char *  sep = "/" 
)

Find a child by path

Parameters
pathItem path
sepPath separator
Returns
ClientFileItem pointer or 0
ClientFileItem* findChildName ( const String name)
inline

Find a child by name

Parameters
nameItem name
Returns
ClientFileItem pointer or 0

References ObjList::find(), and ObjList::get().

bool treeUpdated ( ) const

Recursively check if all (sub)directores were updated

Returns
True if all (sub)directores were updated
bool updated ( ) const
inline

Check if children were updated

Returns
True if children list was updated
void updated ( bool  on)
inline

Set children updated flag

Returns
New value for children updated flag

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