dir_tree_iterator(const filename_tree *initial,
tree::traversal_directions dir)
dir_tree_iterator(const filename_tree *initial,
tree::traversal_directions dir)
: _scanned_okay(false),
_path(new astring(path)),
_pattern(new astring(pattern)),
: _scanned_okay(false),
_path(new astring(path)),
_pattern(new astring(pattern)),
_ignore_files(ignore_files),
_creator(new fname_tree_creator)
{
_ignore_files(ignore_files),
_creator(new fname_tree_creator)
{
// and recursively traverse that sub-node also.
const string_array &dirs = curr.directories();
for (int i = 0; i < dirs.length(); i++) {
// and recursively traverse that sub-node also.
const string_array &dirs = curr.directories();
for (int i = 0; i < dirs.length(); i++) {
astring new_path = path + filename::default_separator() + dirs[i];
#ifdef DEBUG_DIRECTORY_TREE
LOG(astring("seeking path: ") + new_path);
astring new_path = path + filename::default_separator() + dirs[i];
#ifdef DEBUG_DIRECTORY_TREE
LOG(astring("seeking path: ") + new_path);
filename_list *directory_tree::access(dir_tree_iterator &scanning)
{
filename_tree *tof = goto_current(scanning);
filename_list *directory_tree::access(dir_tree_iterator &scanning)
{
filename_tree *tof = goto_current(scanning);
bool found = false;
// start looking at all the items in the list, even though we might have
// to abandon the iteration if we find a match.
bool found = false;
// start looking at all the items in the list, even though we might have
// to abandon the iteration if we find a match.
// we found a partial match. that means we should start looking at this
// node's children for the exact match.
if (!check) {
// this is a serious logical error!
LOG("serious logical error: tree was not located.");
// we found a partial match. that means we should start looking at this
// node's children for the exact match.
if (!check) {
// this is a serious logical error!
LOG("serious logical error: tree was not located.");
}
examining.reset(); // clear the existing nodes.
for (int i = 0; i < check->branches(); i++)
examining += (filename_tree *)check->branch(i);
}
}
examining.reset(); // clear the existing nodes.
for (int i = 0; i < check->branches(); i++)
examining += (filename_tree *)check->branch(i);
}
int comp_index;
astring reassembled; // this will hold the common root.
outcome ret = find_common_root(new_item, true, last_match, reassembled,
pieces, comp_index);
if (!last_match) {
LOG(astring("serious error finding common root for ") + new_item
int comp_index;
astring reassembled; // this will hold the common root.
outcome ret = find_common_root(new_item, true, last_match, reassembled,
pieces, comp_index);
if (!last_match) {
LOG(astring("serious error finding common root for ") + new_item
int comp_index;
astring reassembled;
outcome ret = find_common_root(zap_item, false, last_match, reassembled,
int comp_index;
astring reassembled;
outcome ret = find_common_root(zap_item, false, last_match, reassembled,