Selaa lähdekoodia

Add get_absolute_path to Filesystem

Daniele Bartolini 12 vuotta sitten
vanhempi
sitoutus
ff1f36372f

+ 1 - 0
engine/core/filesystem/FileSource.h

@@ -50,6 +50,7 @@ public:
 	virtual void create_file(const char* path) = 0;
 	virtual void create_file(const char* path) = 0;
 	virtual void delete_file(const char* path) = 0;
 	virtual void delete_file(const char* path) = 0;
 	virtual void list_files(const char* path, Vector<DynamicString>& files) = 0;
 	virtual void list_files(const char* path, Vector<DynamicString>& files) = 0;
+	virtual void get_absolute_path(const char* path, DynamicString& abs_path) = 0;
 
 
 	bool can_write() const
 	bool can_write() const
 	{
 	{

+ 7 - 0
engine/core/filesystem/Filesystem.cpp

@@ -26,6 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "Filesystem.h"
 #include "Filesystem.h"
 #include "FileSource.h"
 #include "FileSource.h"
+#include "DynamicString.h"
 
 
 namespace crown
 namespace crown
 {
 {
@@ -77,4 +78,10 @@ void Filesystem::delete_file(const char* path)
 	m_source->delete_file(path);
 	m_source->delete_file(path);
 }
 }
 
 
+//-----------------------------------------------------------------------------
+void Filesystem::get_absolute_path(const char* path, DynamicString& os_path)
+{
+	m_source->get_absolute_path(path, os_path);
+}
+
 } // namespace crown
 } // namespace crown

+ 3 - 0
engine/core/filesystem/Filesystem.h

@@ -32,6 +32,7 @@ namespace crown
 {
 {
 
 
 class FileSource;
 class FileSource;
+class DynamicString;
 
 
 /// Provides a platform-independent way to access files and directories
 /// Provides a platform-independent way to access files and directories
 /// on the host filesystem.
 /// on the host filesystem.
@@ -92,6 +93,8 @@ public:
 	void				delete_directory(const char* path);
 	void				delete_directory(const char* path);
 	void				create_file(const char* path);
 	void				create_file(const char* path);
 	void				delete_file(const char* path);
 	void				delete_file(const char* path);
+
+	void				get_absolute_path(const char* path, DynamicString& os_path);
 		
 		
 private:
 private: