Daniele Bartolini 9 лет назад
Родитель
Сommit
25ce774738
2 измененных файлов с 10 добавлено и 3 удалено
  1. 7 2
      src/core/filesystem/disk_filesystem.cpp
  2. 3 1
      src/core/filesystem/disk_filesystem.h

+ 7 - 2
src/core/filesystem/disk_filesystem.cpp

@@ -231,12 +231,17 @@ public:
 	}
 };
 
-DiskFilesystem::DiskFilesystem(Allocator& a, const char* prefix)
+DiskFilesystem::DiskFilesystem(Allocator& a)
 	: _allocator(&a)
-	, _prefix(prefix, a)
+	, _prefix(a)
 {
 }
 
+void DiskFilesystem::set_prefix(const char* prefix)
+{
+	_prefix.set(prefix, strlen32(prefix));
+}
+
 File* DiskFilesystem::open(const char* path, FileOpenMode::Enum mode)
 {
 	CE_ASSERT_NOT_NULL(path);

+ 3 - 1
src/core/filesystem/disk_filesystem.h

@@ -25,10 +25,12 @@ class DiskFilesystem : public Filesystem
 
 public:
 
+	DiskFilesystem(Allocator& a);
+
 	/// Sets the root path to the given @a prefix.
 	/// @note
 	/// The @a prefix must be absolute.
-	DiskFilesystem(Allocator& a, const char* prefix);
+	void set_prefix(const char* prefix);
 
 	/// @copydoc Filesystem::open()
 	File* open(const char* path, FileOpenMode::Enum mode);