aboutsummaryrefslogtreecommitdiffstats
path: root/src/Directory.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Directory.hxx30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/Directory.hxx b/src/Directory.hxx
index 380a6b790..031cca877 100644
--- a/src/Directory.hxx
+++ b/src/Directory.hxx
@@ -26,6 +26,8 @@
#include "DatabaseVisitor.hxx"
#include "PlaylistVector.hxx"
+#include <string>
+
#include <sys/types.h>
#define DEVICE_INARCHIVE (dev_t)(-1)
@@ -82,42 +84,22 @@ struct Directory {
ino_t inode;
dev_t device;
bool have_stat; /* not needed if ino_t == dev_t == 0 is impossible */
- char path[sizeof(long)];
-
-protected:
- Directory(const char *path);
- gcc_malloc gcc_nonnull_all
- static Directory *Allocate(const char *path);
+ std::string path;
public:
- /**
- * Default constructor, needed for #detached_root.
- */
- Directory();
+ Directory(const char *_path_utf8, Directory *_parent);
~Directory();
/**
- * Generic constructor for #Directory object.
- */
- gcc_malloc
- static Directory *NewGeneric(const char *path_utf8, Directory *parent);
-
- /**
* Create a new root #Directory object.
*/
gcc_malloc
static Directory *NewRoot() {
- return NewGeneric("", nullptr);
+ return new Directory("", nullptr);
}
/**
- * Free this #Directory object (and the whole object tree within it),
- * assuming it was already removed from the parent.
- */
- void Free();
-
- /**
* Remove this #Directory object from its parent and free it. This
* must not be called with the root Directory.
*
@@ -178,7 +160,7 @@ public:
gcc_pure
const char *GetPath() const {
- return path;
+ return path.c_str();
}
/**