Index: trunk/jenga/src/common/Directory.cpp
===================================================================
--- trunk/jenga/src/common/Directory.cpp	(revision 166)
+++ trunk/jenga/src/common/Directory.cpp	(revision 166)
@@ -0,0 +1,52 @@
+#include <boost/foreach.hpp>
+#include <jenga/include/common/Directory.h>
+
+using namespace std;
+using namespace Jenga::Common;
+
+string Directory::GetFullPath( const string &relationPath )
+{
+	string resultPath = relationPath;
+
+	// '/'→'\'
+	BOOST_FOREACH( char &c, resultPath )
+	{
+		if( c == '/' )
+		{
+			c = '\\';
+		}
+	}
+
+	if( resultPath.find( ":" ) != string::npos || resultPath.find( "\\\\" ) != string::npos )
+	{
+		// フルパスが引き渡されていたとき
+		return resultPath;
+	}
+
+	int i=0,i2=0;
+	while(1){
+		if(resultPath[i]=='.'&&resultPath[i+1]=='\\') i+=2;
+		if(resultPath[i]=='.'&&resultPath[i+1]=='.'&&resultPath[i+2]=='\\'){
+			i2++;
+			i+=3;
+		}
+		else break;
+	}
+
+	int i3 = (int)path.size(),i4=0;
+	while(i4<i2){
+		for(i3--;;i3--){
+			if(path[i3-1]=='\\'){
+				i4++;
+				break;
+			}
+		}
+	}
+
+	char temporary[MAX_PATH];
+	memcpy(temporary,path.c_str(),i3);
+	temporary[i3]=0;
+	lstrcat(temporary,resultPath.c_str()+i);
+
+	return temporary;
+}
