mirror of
https://github.com/textmate/textmate.git
synced 2026-01-20 20:27:59 -05:00
Make fs::tree_t member data private
This commit is contained in:
@@ -234,14 +234,14 @@ namespace fs
|
||||
if(cwd == path)
|
||||
{
|
||||
fs::node_t newNode(cwd);
|
||||
if(node._type != newNode._type || node._modified != newNode._modified)
|
||||
if(node.type() != newNode.type() || node.modified() != newNode.modified())
|
||||
{
|
||||
if(node._type == fs::node_t::kNodeTypeMissing) _changes["created"].push_back(cwd);
|
||||
else if(newNode._type == fs::node_t::kNodeTypeMissing) _changes["deleted"].push_back(cwd);
|
||||
else _changes["changes"].push_back(cwd);
|
||||
if(node.type() == fs::node_t::kNodeTypeMissing) _changes["created"].push_back(cwd);
|
||||
else if(newNode.type() == fs::node_t::kNodeTypeMissing) _changes["deleted"].push_back(cwd);
|
||||
else _changes["changes"].push_back(cwd);
|
||||
|
||||
if(node._type == newNode._type && node._type == fs::node_t::kNodeTypeDirectory)
|
||||
node._entries.swap(newNode._entries);
|
||||
if(node.type() == newNode.type() && node.type() == fs::node_t::kNodeTypeDirectory)
|
||||
newNode.set_entries(node.entries());
|
||||
node = newNode;
|
||||
}
|
||||
node.rescan(path::parent(cwd), _dir_glob, _file_glob, &_changes);
|
||||
|
||||
@@ -23,12 +23,18 @@ namespace fs
|
||||
node_type_t type () const { return _type; }
|
||||
time_t modified () const { return _modified; }
|
||||
nodes_ptr entries () const { return _entries; }
|
||||
void set_entries (nodes_ptr newEntries) { _entries = newEntries; }
|
||||
bool operator== (node_t const& rhs) const { return _name == rhs._name && _resolved == rhs._resolved && _type == rhs._type && _modified == rhs._modified && (!_entries && !rhs._entries || _entries && rhs._entries && *_entries == *rhs._entries); }
|
||||
bool operator!= (node_t const& rhs) const { return !(*this == rhs); }
|
||||
|
||||
node_t (std::string const& name, std::string const& resolved, node_type_t type, time_t modified = 0, nodes_ptr const& entries = nodes_ptr()) : _name(name), _resolved(resolved), _type(type), _modified(modified), _entries(entries) { }
|
||||
node_t& rescan (std::string const& cwd, path::glob_t const& dirGlob, path::glob_t const& fileGlob, std::map< std::string, std::vector<std::string> >* changes = NULL);
|
||||
|
||||
private:
|
||||
node_t (std::string const& name, std::string const& resolved, node_type_t type, time_t modified = 0, nodes_ptr const& entries = nodes_ptr()) : _name(name), _resolved(resolved), _type(type), _modified(modified), _entries(entries) { }
|
||||
|
||||
friend plist::dictionary_t to_plist (node_t const& node);
|
||||
friend node_t from_plist (plist::any_t const& plist);
|
||||
|
||||
std::string _name;
|
||||
std::string _resolved;
|
||||
node_type_t _type;
|
||||
|
||||
Reference in New Issue
Block a user