#include <en_tree.h>
Public Methods | |
EnTree () | |
void | init () |
Initialize a node to safe defaults. | |
~EnTree () | |
Destroys this node and all its descendants. | |
EnTree * | seek_end () |
Find the end of the list. | |
int | add_child (EnTree *child) |
Add a child to this node. | |
void | remove () |
Removes this EnTree from its tree without deleting it. | |
void | set (uintmax_t n_blocks, const char *name) |
Set the name and size of an EnTree node. | |
void | add (uintmax_t n_blocks, const char *name) |
Set the name and increments the size of an EnTree node. | |
void | incr_up (uintmax_t n_blocks) |
increases the size of all ancestors of this block | |
void | set_attribs (struct stat const &stat_buf) |
gid_t | getGid () const |
time_t | getMTime () const |
time_t | getATime () const |
uintmax_t | my_size () const |
Public Attributes | |
char * | name |
The name of the directory entry. | |
uintmax_t | size |
The size of the directory entry (and all children). | |
EnTree * | parent |
The parent of the directory entry. | |
EnTree * | child |
The first child of the directory entry. | |
EnTree * | next |
The next sibling of this directory entry. | |
EnTree * | prev |
The previous sibling of this direcotry entry. | |
int | r |
int | g |
int | b |
uid_t | uid |
The user id of this entry. | |
gid_t | gid |
The group id of the entry. | |
time_t | mtime |
The modification time of the entry. | |
time_t | atime |
The access time of the entry. |
|
|
|
Destroys this node and all its descendants.
|
|
Initialize a node to safe defaults.
00070 { 00071 //using std::random; 00072 EnTree *target=this; 00073 if (target==NULL) return; 00074 target->size=0; 00075 target->next=NULL; 00076 target->prev=NULL; 00077 target->parent=NULL; 00078 target->child=NULL; 00079 target->name=NULL; 00080 target->r=random()%65535; 00081 target->g=random()%65535; 00082 target->b=random()%65535; 00083 } |
|
Find the end of the list.
|
|
Add a child to this node.
|
|
Removes this EnTree from its tree without deleting it.
00055 { 00056 // remove reference in the previous node 00057 if (prev!=NULL) prev->next=next; 00058 00059 // remove reference in the next node 00060 if (next!=NULL) next->prev=prev; 00061 00062 // remove reference in the parent node 00063 if (parent!=NULL && parent->child==this) 00064 parent->child=next; 00065 } |
|
Set the name and size of an EnTree node.
|
|
Set the name and increments the size of an EnTree node.
|
|
increases the size of all ancestors of this block
|
|
|
|
00123 { 00124 return gid; 00125 } |
|
00127 { 00128 return mtime; 00129 } |
|
00131 { 00132 return atime; 00133 } |
|
|
|
The name of the directory entry.
|
|
The size of the directory entry (and all children).
|
|
The parent of the directory entry.
|
|
The first child of the directory entry.
|
|
The next sibling of this directory entry.
|
|
The previous sibling of this direcotry entry.
|
|
|
|
|
|
|
|
The user id of this entry.
|
|
The group id of the entry.
|
|
The modification time of the entry.
|
|
The access time of the entry.
|