1 #ifndef FILENAME_TREE_CLASS
2 #define FILENAME_TREE_CLASS
4 /*****************************************************************************\
6 * Name : filename_tree *
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 2004-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
18 //! This is a support class for the directory_tree.
20 This class has been exported from directory_tree's implementation to
21 avoid redundant code for iteration and such.
22 Note: this is a heavy-weight header that should not be included in other
26 #include "filename_list.h"
28 #include <nodes/packable_tree.h>
30 namespace filesystem {
32 class filename_tree : public nodes::packable_tree
35 filename _dirname; //!< the full directory name at this position.
36 filename_list _files; //!< the filenames that are at this node in the tree.
37 int _depth; //!< how far below root node are we.
41 virtual ~filename_tree();
43 virtual int packed_size() const;
45 virtual void pack(basis::byte_array &packed_form) const;
47 virtual bool unpack(basis::byte_array &packed_form);
50 //! this is the tree factory used in the recursive_unpack.
51 /*! it meets our needs for regenerating these objects from a streamed form. */
52 class fname_tree_creator : public nodes::packable_tree_factory
55 //// virtual ~fname_tree_creator() {}
56 virtual nodes::packable_tree *create();
57 //!< implements the create() method for filename_trees to support packing.