Skip to content

Commit

Permalink
Refactor: Renamed PathDirectory[Node] as PathTree[Node]
Browse files Browse the repository at this point in the history
This is a better name for this class which carries more meaning about
it's design and intended purpose.
  • Loading branch information
danij-deng committed Oct 23, 2012
1 parent b18c2f7 commit c294fa4
Show file tree
Hide file tree
Showing 23 changed files with 683 additions and 682 deletions.
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/con_main.h
Expand Up @@ -34,7 +34,7 @@
#include "dd_types.h"
#include "de_system.h"
#include "dd_input.h"
#include "pathdirectory.h"
#include "pathtree.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -92,7 +92,7 @@ typedef struct cvar_s {
cvartype_t type;

/// Pointer to this variable's node in the directory.
PathDirectoryNode* directoryNode;
PathTreeNode* directoryNode;

/// Pointer to the user data.
void* ptr;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/file.h
Expand Up @@ -36,7 +36,7 @@
namespace de {

class LumpIndex;
class PathDirectoryNode;
class PathTreeNode;

/**
* File. File is a core component of the filesystem intended for use as the base
Expand Down Expand Up @@ -144,7 +144,7 @@ class File1
*
* @return Directory node for this file.
*/
virtual PathDirectoryNode const& directoryNode() const
virtual PathTreeNode const& directoryNode() const
{
throw de::Error("File1::directoryNode", "No owner directory");
}
Expand Down
24 changes: 12 additions & 12 deletions doomsday/engine/portable/include/filedirectory.h
Expand Up @@ -4,7 +4,7 @@
* FileDirectory. Core system component representing a hierarchical file path
* structure.
*
* A specialization of de::PathDirectory which implements automatic population
* A specialization of de::PathTree which implements automatic population
* of the directory itself from the virtual file system.
*
* @note Paths are resolved prior to pushing them into the directory.
Expand Down Expand Up @@ -33,13 +33,13 @@
#define LIBDENG_FILEDIRECTORY_H

#include "uri.h"
#include "pathdirectory.h"
#include "pathtree.h"

#ifdef __cplusplus

namespace de {

class FileDirectory : private PathDirectory
class FileDirectory : private PathTree
{
public:
/**
Expand Down Expand Up @@ -68,7 +68,7 @@ class FileDirectory : private PathDirectory
*
* @return @c true iff successful.
*/
bool find(PathDirectoryNodeType type, char const* searchPath, char searchDelimiter = '/',
bool find(PathTreeNodeType type, char const* searchPath, char searchDelimiter = '/',
ddstring_t* foundPath = 0, char foundDelimiter = '/');

/**
Expand All @@ -81,7 +81,7 @@ class FileDirectory : private PathDirectory
* @param parameters Passed to the callback.
*/
void addPaths(int flags, Uri const* const* searchPaths, uint searchPathsCount,
int (*callback) (PathDirectoryNode& node, void* parameters) = 0,
int (*callback) (PathTreeNode& node, void* parameters) = 0,
void* parameters = 0);

/**
Expand All @@ -93,7 +93,7 @@ class FileDirectory : private PathDirectory
* @param parameters Passed to the callback.
*/
void addPathList(int flags, char const* pathList,
int (*callback) (PathDirectoryNode& node, void* parameters) = 0, void* parameters = 0);
int (*callback) (PathTreeNode& node, void* parameters) = 0, void* parameters = 0);

/**
* Collate all paths in the directory into a list.
Expand All @@ -115,10 +115,10 @@ class FileDirectory : private PathDirectory
private:
void clearNodeInfo();

PathDirectoryNode* addPathNodes(ddstring_t const* rawPath);
PathTreeNode* addPathNodes(ddstring_t const* rawPath);

int addChildNodes(PathDirectoryNode& node, int flags,
int (*callback) (PathDirectoryNode& node, void* parameters),
int addChildNodes(PathTreeNode& node, int flags,
int (*callback) (PathTreeNode& node, void* parameters),
void* parameters);

/**
Expand All @@ -131,16 +131,16 @@ class FileDirectory : private PathDirectory
* @return Non-zero if the current iteration should stop else @c 0.
*/
int addPathNodesAndMaybeDescendBranch(bool descendBranches, ddstring_t const* filePath,
PathDirectoryNodeType nodeType, int flags,
int (*callback) (PathDirectoryNode& node, void* parameters),
PathTreeNodeType nodeType, int flags,
int (*callback) (PathTreeNode& node, void* parameters),
void* parameters);

private:
/// Used with relative path directories.
ddstring_t* basePath;

/// Used with relative path directories.
PathDirectoryNode* baseNode;
PathTreeNode* baseNode;
};

} // namespace de
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/fs_main.h
Expand Up @@ -34,7 +34,7 @@

#include "file.h"
#include "filehandle.h"
#include "pathdirectory.h"
#include "pathtree.h"

#ifdef __cplusplus

Expand Down

0 comments on commit c294fa4

Please sign in to comment.