Changeset 0d28542b5ed2…
Parent 313005ffe01e…
by
Changes to 2 files · Browse files at 0d28542b5ed2 Showing diff from parent 313005ffe01e Diff from another changeset...
@@ -21,6 +21,17 @@ #include "Winstat.h"
+Directory::Directory(
+ Directory* p, const std::string& n, const std::string& basepath
+):
+ parent_(p), name_(n), tickcount_(0), status_(-1)
+{
+ path_ = basepath;
+ if (!n.empty())
+ path_ += "/" + n;
+}
+
+
Directory::~Directory()
{
for (DirsT::iterator i = subdirs_.begin(); i != subdirs_.end(); ++i)
@@ -149,18 +160,6 @@}
-std::string Directory::path() const
-{
- if (basepath_.empty())
- return name_;
-
- if (name_.empty())
- return basepath_;
-
- return basepath_ + "/" + name_;
-}
-
-
char Directory::status_imp(const std::string& hgroot)
{
bool added = false;
|
@@ -31,7 +31,7 @@
Directory* const parent_;
const std::string name_;
- const std::string basepath_;
+ std::string path_;
DirsT subdirs_;
FilesT files_;
@@ -40,12 +40,10 @@ char status_;
public:
- Directory(Directory* p, const std::string& n, const std::string& basepath):
- parent_(p), name_(n), basepath_(basepath), tickcount_(0), status_(-1) {}
-
+ Directory(Directory* p, const std::string& n, const std::string& basepath);
~Directory();
- std::string path() const;
+ const std::string& path() const { return path_; }
int add(const std::string& relpath, Direntry& e);
|
Loading...