فهرست منبع

WIP: Linux port
- Paths are now stored in UTF8 internally
- Added code for locating MonoDevelop installation

Marko Pintera 8 سال پیش
والد
کامیت
02e7485988

+ 10 - 0
Source/BansheeCore/Linux/BsLinuxPlatform.cpp

@@ -13,6 +13,7 @@
 #include <X11/Xcursor/Xcursor.h>
 #include <X11/Xcursor/Xcursor.h>
 #include <X11/Xlib.h>
 #include <X11/Xlib.h>
 #include <X11/XKBlib.h>
 #include <X11/XKBlib.h>
+#include <pwd.h>
 
 
 namespace bs
 namespace bs
 {
 {
@@ -1222,6 +1223,15 @@ namespace bs
 		return mData->mainXWindow;
 		return mData->mainXWindow;
 	}
 	}
 
 
+	Path LinuxPlatform::getHomeDir()
+	{
+		const char* homeDir = getenv("HOME");
+		if(!homeDir)
+			homeDir = getpwuid(getuid())->pw_dir;
+
+		return Path(homeDir);
+	}
+
 	void LinuxPlatform::lockX()
 	void LinuxPlatform::lockX()
 	{
 	{
 		mData->lock.lock();
 		mData->lock.lock();

+ 3 - 0
Source/BansheeCore/Linux/BsLinuxPlatform.h

@@ -26,6 +26,9 @@ namespace bs
 		/** Returns the main X11 window. Caller must ensure the main window has been created. */
 		/** Returns the main X11 window. Caller must ensure the main window has been created. */
 		static ::Window getMainXWindow();
 		static ::Window getMainXWindow();
 
 
+		/** Retruns the absolute path to the user's home directory. */
+		static Path getHomeDir();
+
 		/** Locks access to the X11 system, not allowing any other thread to access it. Must be used for every X11 access. */
 		/** Locks access to the X11 system, not allowing any other thread to access it. Must be used for every X11 access. */
 		static void lockX();
 		static void lockX();
 
 

+ 6 - 1
Source/BansheeEditor/CodeEditor/BsMDCodeEditor.cpp

@@ -4,6 +4,7 @@
 #include "FileSystem/BsFileSystem.h"
 #include "FileSystem/BsFileSystem.h"
 #include "FileSystem/BsDataStream.h"
 #include "FileSystem/BsDataStream.h"
 #include "String/BsUnicode.h"
 #include "String/BsUnicode.h"
+#include "Linux/BsLinuxPlatform.h"
 
 
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 #include <Windows.h>
 #include <Windows.h>
@@ -118,7 +119,11 @@ namespace bs
 
 
 		mInstallPath = Path(installPath) + Path("XamarinStudio.exe");
 		mInstallPath = Path(installPath) + Path("XamarinStudio.exe");
 #elif BS_PLATFORM == BS_PLATFORM_LINUX
 #elif BS_PLATFORM == BS_PLATFORM_LINUX
-		static_assert(false);
+		Path monoDevelopDir = LinuxPlatform::getHomeDir();
+		monoDevelopDir.append(".local/share/flatpak/app/com.xamarin.MonoDevelop");
+
+		if(FileSystem::exists(monoDevelopDir))
+			mInstallPath = monoDevelopDir;
 #endif
 #endif
 
 
 		if (!mInstallPath.isEmpty())
 		if (!mInstallPath.isEmpty())

+ 4 - 3
Source/BansheeEditor/GUI/BsGUIResourceTreeView.cpp

@@ -8,6 +8,7 @@
 #include "RenderAPI/BsViewport.h"
 #include "RenderAPI/BsViewport.h"
 #include "RenderAPI/BsRenderWindow.h"
 #include "RenderAPI/BsRenderWindow.h"
 #include "Platform/BsDropTarget.h"
 #include "Platform/BsDropTarget.h"
+#include "String/BsUnicode.h"
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
 
 
@@ -215,9 +216,9 @@ namespace bs
 			if (idx == numElems)
 			if (idx == numElems)
 				return current;
 				return current;
 
 
-			WString curElem;
+			String curElem;
 			if (relPath.isFile() && idx == (numElems - 1))
 			if (relPath.isFile() && idx == (numElems - 1))
-				curElem = relPath.getWFilename();
+				curElem = relPath.getFilename();
 			else
 			else
 				curElem = relPath[idx];
 				curElem = relPath[idx];
 
 
@@ -225,7 +226,7 @@ namespace bs
 			for (auto& child : current->mChildren)
 			for (auto& child : current->mChildren)
 			{
 			{
 				ResourceTreeElement* resourceChild = static_cast<ResourceTreeElement*>(child);
 				ResourceTreeElement* resourceChild = static_cast<ResourceTreeElement*>(child);
-				if (Path::comparePathElem(curElem, resourceChild->mElementName))
+				if (Path::comparePathElem(curElem, UTF8::fromWide(resourceChild->mElementName)))
 				{
 				{
 					idx++;
 					idx++;
 					current = resourceChild;
 					current = resourceChild;

+ 5 - 4
Source/BansheeEditor/Library/BsProjectLibrary.cpp

@@ -16,6 +16,7 @@
 #include "Resources/BsResource.h"
 #include "Resources/BsResource.h"
 #include "BsEditorApplication.h"
 #include "BsEditorApplication.h"
 #include "Material/BsShader.h"
 #include "Material/BsShader.h"
+#include "String/BsUnicode.h"
 #include <regex>
 #include <regex>
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
@@ -679,9 +680,9 @@ namespace bs
 			if (idx == numElems)
 			if (idx == numElems)
 				return current;
 				return current;
 
 
-			WString curElem;
+			String curElem;
 			if (relPath.isFile() && idx == (numElems - 1))
 			if (relPath.isFile() && idx == (numElems - 1))
-				curElem = relPath.getWFilename();
+				curElem = relPath.getFilename();
 			else
 			else
 				curElem = relPath[idx];
 				curElem = relPath[idx];
 
 
@@ -691,7 +692,7 @@ namespace bs
 				current = nullptr;
 				current = nullptr;
 				for (auto& child : dirEntry->mChildren)
 				for (auto& child : dirEntry->mChildren)
 				{
 				{
-					if (Path::comparePathElem(curElem, child->elementName))
+					if (Path::comparePathElem(curElem, UTF8::fromWide(child->elementName)))
 					{
 					{
 						idx++;
 						idx++;
 						current = child;
 						current = child;
@@ -765,7 +766,7 @@ namespace bs
 				DirectoryEntry* dirEntry = static_cast<DirectoryEntry*>(entry);
 				DirectoryEntry* dirEntry = static_cast<DirectoryEntry*>(entry);
 				for (auto& child : dirEntry->mChildren)
 				for (auto& child : dirEntry->mChildren)
 				{
 				{
-					if (Path::comparePathElem(path.getWTail(), child->elementName))
+					if (Path::comparePathElem(path.getTail(), UTF8::fromWide(child->elementName)))
 					{
 					{
 						if (child->type == LibraryEntryType::File)
 						if (child->type == LibraryEntryType::File)
 						{
 						{

+ 86 - 60
Source/BansheeUtility/FileSystem/BsPath.cpp

@@ -1,5 +1,6 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include <Debug/BsDebug.h>
 #include "Prerequisites/BsPrerequisitesUtil.h"
 #include "Prerequisites/BsPrerequisitesUtil.h"
 #include "Error/BsException.h"
 #include "Error/BsException.h"
 #include "String/BsUnicode.h"
 #include "String/BsUnicode.h"
@@ -154,14 +155,14 @@ namespace bs
 		switch (type)
 		switch (type)
 		{
 		{
 		case PathType::Windows:
 		case PathType::Windows:
-			return buildWindows();
+			return UTF8::toWide(buildWindows());
 		case PathType::Unix:
 		case PathType::Unix:
-			return buildUnix();
+			return UTF8::toWide(buildUnix());
 		default:
 		default:
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 #if BS_PLATFORM == BS_PLATFORM_WIN32
-			return buildWindows();
+			return UTF8::toWide(buildWindows());
 #elif BS_PLATFORM == BS_PLATFORM_OSX || BS_PLATFORM == BS_PLATFORM_LINUX
 #elif BS_PLATFORM == BS_PLATFORM_OSX || BS_PLATFORM == BS_PLATFORM_LINUX
-			return buildUnix();
+			return UTF8::toWide(buildUnix());
 #else
 #else
 			static_assert(false, "Unsupported platform for path.");
 			static_assert(false, "Unsupported platform for path.");
 #endif
 #endif
@@ -174,14 +175,14 @@ namespace bs
 		switch (type)
 		switch (type)
 		{
 		{
 		case PathType::Windows:
 		case PathType::Windows:
-			return UTF8::fromWide(buildWindows());
+			return buildWindows();
 		case PathType::Unix:
 		case PathType::Unix:
-			return UTF8::fromWide(buildUnix());
+			return buildUnix();
 		default:
 		default:
 #if BS_PLATFORM == BS_PLATFORM_WIN32
 #if BS_PLATFORM == BS_PLATFORM_WIN32
-			return UTF8::fromWide(buildWindows());
+			return buildWindows();
 #elif BS_PLATFORM == BS_PLATFORM_OSX || BS_PLATFORM == BS_PLATFORM_LINUX
 #elif BS_PLATFORM == BS_PLATFORM_OSX || BS_PLATFORM == BS_PLATFORM_LINUX
-			return UTF8::fromWide(buildUnix());
+			return buildUnix();
 #else
 #else
 			static_assert(false, "Unsupported platform for path.");
 			static_assert(false, "Unsupported platform for path.");
 #endif
 #endif
@@ -228,12 +229,12 @@ namespace bs
 			if (mDirectories.empty())
 			if (mDirectories.empty())
 			{
 			{
 				if (!mIsAbsolute)
 				if (!mIsAbsolute)
-					mDirectories.push_back(L"..");
+					mDirectories.push_back("..");
 			}
 			}
 			else
 			else
 			{
 			{
-				if (mDirectories.back() == L"..")
-					mDirectories.push_back(L"..");
+				if (mDirectories.back() == "..")
+					mDirectories.push_back("..");
 				else
 				else
 					mDirectories.pop_back();
 					mDirectories.pop_back();
 			}
 			}
@@ -278,11 +279,11 @@ namespace bs
 			if (mDirectories.size() > 0)
 			if (mDirectories.size() > 0)
 				mDirectories.erase(mDirectories.begin());
 				mDirectories.erase(mDirectories.begin());
 			else
 			else
-				mFilename = L"";
+				mFilename = "";
 		}
 		}
 
 
-		mDevice = L"";
-		mNode = L"";
+		mDevice = "";
+		mNode = "";
 		mIsAbsolute = false;
 		mIsAbsolute = false;
 
 
 		return *this;
 		return *this;
@@ -409,31 +410,41 @@ namespace bs
 		return *this;
 		return *this;
 	}
 	}
 
 
+	void Path::setFilename(const WString& filename)
+	{
+		mFilename = UTF8::fromWide(filename);
+	}
+
 	void Path::setBasename(const WString& basename)
 	void Path::setBasename(const WString& basename)
 	{
 	{
-		mFilename = basename + getWExtension();
+		mFilename = UTF8::fromWide(basename) + getExtension();
 	}
 	}
 
 
 	void Path::setBasename(const String& basename)
 	void Path::setBasename(const String& basename)
 	{
 	{
-		mFilename = bs::toWString(basename) + getWExtension();
+		mFilename = basename + getExtension();
 	}
 	}
 
 
 	void Path::setExtension(const WString& extension)
 	void Path::setExtension(const WString& extension)
 	{
 	{
-		WStringStream stream;
-		stream << getWFilename(false);
+		setExtension(UTF8::fromWide(extension));
+	}
+
+	void Path::setExtension(const String& extension)
+	{
+		StringStream stream;
+		stream << getFilename(false);
 		stream << extension;
 		stream << extension;
 
 
 		mFilename = stream.str();
 		mFilename = stream.str();
 	}
 	}
 
 
-	void Path::setExtension(const String& extension)
+	WString Path::getWFilename(bool extension) const
 	{
 	{
-		setExtension(bs::toWString(extension));
+		return UTF8::toWide(getFilename(extension));
 	}
 	}
 
 
-	WString Path::getWFilename(bool extension) const
+	String Path::getFilename(bool extension) const
 	{
 	{
 		if (extension)
 		if (extension)
 			return mFilename;
 			return mFilename;
@@ -447,54 +458,59 @@ namespace bs
 		}
 		}
 	}
 	}
 
 
-	String Path::getFilename(bool extension) const
+	WString Path::getWExtension() const
 	{
 	{
-		return bs::toString(getWFilename(extension));
+		return UTF8::toWide(getExtension());
 	}
 	}
 
 
-	WString Path::getWExtension() const
+	String Path::getExtension() const
 	{
 	{
 		WString::size_type pos = mFilename.rfind(L'.');
 		WString::size_type pos = mFilename.rfind(L'.');
 		if (pos != WString::npos)
 		if (pos != WString::npos)
 			return mFilename.substr(pos);
 			return mFilename.substr(pos);
 		else
 		else
-			return WString();
+			return String();
 	}
 	}
 
 
-	String Path::getExtension() const
+	WString Path::getWDirectory(UINT32 idx) const
 	{
 	{
-		return bs::toString(getWExtension());
+		return UTF8::toWide(getDirectory(idx));
 	}
 	}
 
 
-	const WString& Path::getWDirectory(UINT32 idx) const
+	const String& Path::getDirectory(UINT32 idx) const
 	{
 	{
 		if (idx >= (UINT32)mDirectories.size())
 		if (idx >= (UINT32)mDirectories.size())
 		{
 		{
-			BS_EXCEPT(InvalidParametersException, "Index out of range: " + bs::toString(idx) + 
-				". Valid range: [0, " + bs::toString((UINT32)mDirectories.size() - 1) + "]");
+			BS_EXCEPT(InvalidParametersException, "Index out of range: " + bs::toString(idx) + ". Valid range: [0, " +
+					bs::toString((UINT32)mDirectories.size() - 1) + "]");
 		}
 		}
 
 
 		return mDirectories[idx];
 		return mDirectories[idx];
 	}
 	}
 
 
-	String Path::getDirectory(UINT32 idx) const
+	WString Path::getWDevice() const
+	{
+		return UTF8::toWide(mDevice);
+	}
+
+	WString Path::getWNode() const
 	{
 	{
-		return bs::toString(getWDirectory(idx));
+		return UTF8::toWide(mNode);
 	}
 	}
 
 
-	WString Path::getWTail(PathType type) const
+	const String& Path::getTail() const
 	{
 	{
 		if (isFile())
 		if (isFile())
 			return mFilename;
 			return mFilename;
 		else if (mDirectories.size() > 0)
 		else if (mDirectories.size() > 0)
 			return mDirectories.back();
 			return mDirectories.back();
 		else
 		else
-			return StringUtil::WBLANK;
+			return StringUtil::BLANK;
 	}
 	}
 
 
-	String Path::getTail(PathType type) const
+	WString Path::getWTail() const
 	{
 	{
-		return bs::toString(getWTail(type));
+		return UTF8::toWide(getTail());
 	}
 	}
 
 
 	void Path::clear()
 	void Path::clear()
@@ -516,61 +532,71 @@ namespace bs
 		BS_EXCEPT(InvalidParametersException, "Incorrectly formatted path provided: " + path);
 		BS_EXCEPT(InvalidParametersException, "Incorrectly formatted path provided: " + path);
 	}
 	}
 
 
-	WString Path::buildWindows() const
+	void Path::setNode(const WString& node)
+	{
+		mNode = UTF8::fromWide(node);
+	}
+
+	void Path::setDevice(const WString& device)
+	{
+		mNode = UTF8::fromWide(device);
+	}
+
+	String Path::buildWindows() const
 	{
 	{
-		WStringStream result;
+		StringStream result;
 		if (!mNode.empty())
 		if (!mNode.empty())
 		{
 		{
-			result << L"\\\\";
+			result << "\\\\";
 			result << mNode;
 			result << mNode;
-			result << L"\\";
+			result << "\\";
 		}
 		}
 		else if (!mDevice.empty())
 		else if (!mDevice.empty())
 		{
 		{
 			result << mDevice;
 			result << mDevice;
-			result << L":\\";
+			result << ":\\";
 		}
 		}
 		else if (mIsAbsolute)
 		else if (mIsAbsolute)
 		{
 		{
-			result << L"\\";
+			result << "\\";
 		}
 		}
 
 
 		for (auto& dir : mDirectories)
 		for (auto& dir : mDirectories)
 		{
 		{
 			result << dir;
 			result << dir;
-			result << L"\\";
+			result << "\\";
 		}
 		}
 
 
 		result << mFilename;
 		result << mFilename;
 		return result.str();
 		return result.str();
 	}
 	}
 
 
-	WString Path::buildUnix() const
+	String Path::buildUnix() const
 	{
 	{
-		WStringStream result;
+		StringStream result;
 		auto dirIter = mDirectories.begin();
 		auto dirIter = mDirectories.begin();
 
 
 		if (!mDevice.empty())
 		if (!mDevice.empty())
 		{
 		{
-			result << L"/";
+			result << "/";
 			result << mDevice;
 			result << mDevice;
-			result << L":/";
+			result << ":/";
 		}
 		}
 		else if (mIsAbsolute)
 		else if (mIsAbsolute)
 		{
 		{
-			if (dirIter != mDirectories.end() && *dirIter == L"~")
+			if (dirIter != mDirectories.end() && *dirIter == "~")
 			{
 			{
-				result << L"~";
+				result << "~";
 				dirIter++;
 				dirIter++;
 			}
 			}
 
 
-			result << L"/";
+			result << "/";
 		}
 		}
 
 
 		for (; dirIter != mDirectories.end(); ++dirIter)
 		for (; dirIter != mDirectories.end(); ++dirIter)
 		{
 		{
 			result << *dirIter;
 			result << *dirIter;
-			result << L"/";
+			result << "/";
 		}
 		}
 
 
 		result << mFilename;
 		result << mFilename;
@@ -587,7 +613,7 @@ namespace bs
 		return append(rhs);
 		return append(rhs);
 	}
 	}
 
 
-	bool Path::comparePathElem(const WString& left, const WString& right)
+	bool Path::comparePathElem(const String& left, const String& right)
 	{
 	{
 		if (left.size() != right.size())
 		if (left.size() != right.size())
 			return false;
 			return false;
@@ -610,11 +636,16 @@ namespace bs
 
 
 	void Path::pushDirectory(const WString& dir)
 	void Path::pushDirectory(const WString& dir)
 	{
 	{
-		if (!dir.empty() && dir != L".")
+		pushDirectory(UTF8::fromWide(dir));
+	}
+
+	void Path::pushDirectory(const String& dir)
+	{
+		if (!dir.empty() && dir != ".")
 		{
 		{
-			if (dir == L"..")
+			if (dir == "..")
 			{
 			{
-				if (!mDirectories.empty() && mDirectories.back() != L"..")
+				if (!mDirectories.empty() && mDirectories.back() != "..")
 					mDirectories.pop_back();
 					mDirectories.pop_back();
 				else
 				else
 					mDirectories.push_back(dir);
 					mDirectories.push_back(dir);
@@ -623,9 +654,4 @@ namespace bs
 				mDirectories.push_back(dir);
 				mDirectories.push_back(dir);
 		}
 		}
 	}
 	}
-
-	void Path::pushDirectory(const String& dir)
-	{
-		pushDirectory(bs::toWString(dir));
-	}
 }
 }

+ 23 - 29
Source/BansheeUtility/FileSystem/BsPath.h

@@ -4,7 +4,7 @@
 
 
 #include "Prerequisites/BsPlatformDefines.h"
 #include "Prerequisites/BsPlatformDefines.h"
 #include "String/BsString.h"
 #include "String/BsString.h"
-#include "Utility/BsUtil.h"                // For hash_combine()
+#include "Utility/BsUtil.h"
 
 
 namespace bs
 namespace bs
 {
 {
@@ -112,7 +112,7 @@ namespace bs
 		bool operator!= (const Path& path) const { return !equals(path); }
 		bool operator!= (const Path& path) const { return !equals(path); }
 
 
 		/** Gets a directory name with the specified index from the path. */
 		/** Gets a directory name with the specified index from the path. */
-		const WString& operator[] (UINT32 idx) const { return getWDirectory(idx); }
+		const String& operator[] (UINT32 idx) const { return getDirectory(idx); }
 
 
 		/** Swap internal data with another Path object. */
 		/** Swap internal data with another Path object. */
 		void swap(Path& path);
 		void swap(Path& path);
@@ -260,10 +260,10 @@ namespace bs
 		bool equals(const Path& other) const;
 		bool equals(const Path& other) const;
 
 
 		/** Change or set the filename in the path. */
 		/** Change or set the filename in the path. */
-		void setFilename(const WString& filename) { mFilename = filename; }
+		void setFilename(const WString& filename);
 
 
 		/** Change or set the filename in the path. */
 		/** Change or set the filename in the path. */
-		void setFilename(const String& filename) { mFilename = bs::toWString(filename); }
+		void setFilename(const String& filename) { mFilename = filename; }
 
 
 		/**
 		/**
 		 * Change or set the base name in the path. Base name changes the filename by changing its base to the provided 
 		 * Change or set the base name in the path. Base name changes the filename by changing its base to the provided 
@@ -315,40 +315,34 @@ namespace bs
 		UINT32 getNumDirectories() const { return (UINT32)mDirectories.size(); }
 		UINT32 getNumDirectories() const { return (UINT32)mDirectories.size(); }
 
 
 		/** Gets a directory name with the specified index from the path. */
 		/** Gets a directory name with the specified index from the path. */
-		const WString& getWDirectory(UINT32 idx) const;
+		WString getWDirectory(UINT32 idx) const;
 
 
 		/** Gets a directory name with the specified index from the path. */
 		/** Gets a directory name with the specified index from the path. */
-		String getDirectory(UINT32 idx) const;
+		const String& getDirectory(UINT32 idx) const;
 
 
 		/** Returns path device (for example drive, volume, etc.) if one exists in the path. */
 		/** Returns path device (for example drive, volume, etc.) if one exists in the path. */
-		const WString& getWDevice() const { return mDevice; }
+		WString getWDevice() const;
 
 
 		/** Returns path device (for example drive, volume, etc.) if one exists in the path. */
 		/** Returns path device (for example drive, volume, etc.) if one exists in the path. */
-		String getDevice() const { return bs::toString(mDevice); }
+		const String& getDevice() const { return mDevice; }
 
 
 		/** Returns path node (for example network name) if one exists in the path. */
 		/** Returns path node (for example network name) if one exists in the path. */
-		const WString& getWNode() const { return mNode; }
+		WString getWNode() const;
 
 
 		/** Returns path node (for example network name) if one exists in the path. */
 		/** Returns path node (for example network name) if one exists in the path. */
-		String getNode() const { return bs::toString(mNode); }
+		const String& getNode() const { return mNode; }
 
 
 		/**
 		/**
 		 * Gets last element in the path, filename if it exists, otherwise the last directory. If no directories exist 
 		 * Gets last element in the path, filename if it exists, otherwise the last directory. If no directories exist 
 		 * returns device or node.
 		 * returns device or node.
-		 *
-		 * @param[in]	type	Determines format of node or device, in case they are returned. When default, format for 
-		 *						the active platform will be used, otherwise the format defined by the parameter will be used.
 		 */
 		 */
-		WString getWTail(PathType type = PathType::Default) const;
+		WString getWTail() const;
 
 
 		/**
 		/**
 		 * Gets last element in the path, filename if it exists, otherwise the last directory. If no directories exist 
 		 * Gets last element in the path, filename if it exists, otherwise the last directory. If no directories exist 
 		 * returns device or node.
 		 * returns device or node.
-		 *
-		 * @param[in]	type	Determines format of node or device, in case they are returned. When default, format for the
-		 *						active platform will be used, otherwise the format defined by the parameter will be used.
 		 */
 		 */
-		String getTail(PathType type = PathType::Default) const;
+		const String& getTail() const;
 
 
 		/** Clears the path to nothing. */
 		/** Clears the path to nothing. */
 		void clear();
 		void clear();
@@ -363,7 +357,7 @@ namespace bs
 		Path& operator+= (const Path& rhs);
 		Path& operator+= (const Path& rhs);
 
 
 		/** Compares two path elements (filenames, directory names, etc.). */
 		/** Compares two path elements (filenames, directory names, etc.). */
-		static bool comparePathElem(const WString& left, const WString& right);
+		static bool comparePathElem(const String& left, const String& right);
 
 
 		/** Combines two paths and returns the result. Right path should be relative. */
 		/** Combines two paths and returns the result. Right path should be relative. */
 		static Path combine(const Path& left, const Path& right);
 		static Path combine(const Path& left, const Path& right);
@@ -539,17 +533,17 @@ namespace bs
 			}
 			}
 		}
 		}
 
 
-		void setNode(const WString& node) { mNode = node; }
-		void setNode(const String& node) { mNode = bs::toWString(node); }
+		void setNode(const WString& node);
+		void setNode(const String& node) { mNode = node; }
 
 
-		void setDevice(const WString& device) { mDevice = device; }
-		void setDevice(const String& device) { mDevice = bs::toWString(device); }
+		void setDevice(const WString& device);
+		void setDevice(const String& device) { mDevice = device; }
 
 
 		/** Build a Windows path string from internal path data. */
 		/** Build a Windows path string from internal path data. */
-		WString buildWindows() const;
+		String buildWindows() const;
 
 
 		/** Build a Unix path string from internal path data. */
 		/** Build a Unix path string from internal path data. */
-		WString buildUnix() const;
+		String buildUnix() const;
 
 
 		/** Add new directory to the end of the path. */
 		/** Add new directory to the end of the path. */
 		void pushDirectory(const WString& dir);
 		void pushDirectory(const WString& dir);
@@ -566,10 +560,10 @@ namespace bs
 		friend struct RTTIPlainType<Path>; // For serialization
 		friend struct RTTIPlainType<Path>; // For serialization
 		friend struct ::std::hash<bs::Path>;
 		friend struct ::std::hash<bs::Path>;
 
 
-		Vector<WString> mDirectories;
-		WString mDevice;
-		WString mFilename;
-		WString mNode;
+		Vector<String> mDirectories;
+		String mDevice;
+		String mFilename;
+		String mNode;
 		bool mIsAbsolute;
 		bool mIsAbsolute;
 	};
 	};