filesystem::filename_tree Class Reference

#include <filename_tree.h>

Inheritance diagram for filesystem::filename_tree:
Inheritance graph
[legend]
Collaboration diagram for filesystem::filename_tree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 filename_tree ()
virtual ~filename_tree ()
virtual int packed_size () const
 Estimates the space needed for the packed structure.
virtual void pack (basis::byte_array &packed_form) const
 Creates a packed form of the packable object in "packed_form".
virtual bool unpack (basis::byte_array &packed_form)
 Restores the packable from the "packed_form".

Public Attributes

filename _dirname
 the full directory name at this position.
filename_list _files
 the filenames that are at this node in the tree.
int _depth
 how far below root node are we.

Detailed Description

Definition at line 32 of file filename_tree.h.


Constructor & Destructor Documentation

filesystem::filename_tree::filename_tree (  ) 

Definition at line 29 of file filename_tree.cpp.

filesystem::filename_tree::~filename_tree (  )  [virtual]

Definition at line 31 of file filename_tree.cpp.

References _dirname, _files, and structures::amorph< contents >::reset().


Member Function Documentation

void filesystem::filename_tree::pack ( basis::byte_array packed_form  )  const [virtual]

Creates a packed form of the packable object in "packed_form".

This must append to the data in "packed_form" rather than clearing prior contents.

Implements basis::packable.

Definition at line 37 of file filename_tree.cpp.

References _depth, _dirname, _files, nodes::tree::attach(), filesystem::filename_list::pack(), and filesystem::filename::pack().

int filesystem::filename_tree::packed_size (  )  const [virtual]

Estimates the space needed for the packed structure.

Implements basis::packable.

Definition at line 33 of file filename_tree.cpp.

References _dirname, _files, filesystem::filename_list::packed_size(), filesystem::filename::packed_size(), and structures::PACKED_SIZE_INT32.

bool filesystem::filename_tree::unpack ( basis::byte_array packed_form  )  [virtual]

Restores the packable from the "packed_form".

This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.

Implements basis::packable.

Definition at line 43 of file filename_tree.cpp.

References _depth, _dirname, _files, structures::detach(), filesystem::filename_list::unpack(), and filesystem::filename::unpack().


Member Data Documentation

how far below root node are we.

Definition at line 37 of file filename_tree.h.

Referenced by filesystem::directory_tree::add_path(), filesystem::directory_tree::depth(), pack(), and unpack().


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:25:32 2012 for hoople2 project by  doxygen 1.6.3