Index: trunk/ab5.0/jenga/src/common/Directory.cpp
===================================================================
--- trunk/ab5.0/jenga/src/common/Directory.cpp	(revision 607)
+++ trunk/ab5.0/jenga/src/common/Directory.cpp	(revision 620)
@@ -14,6 +14,10 @@
 	}
 }
+Directory::Directory( const Directory &dir )
+	: path( dir.path )
+{
+}
 
-std::string Directory::GetFullPath( const std::string &relationPath )
+std::string Directory::GetFullPath( const std::string &relationPath ) const
 {
 	std::string resultPath = relationPath;
@@ -61,2 +65,75 @@
 	return temporary;
 }
+
+void _GetRelationalPath(char *path,const char *dir){
+	//相対パスを取得
+	int i,i2,i3,i4,i5;
+	char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH],temp4[MAX_PATH];
+
+	//ドライブ名をチェック
+	_splitpath(path,temporary,0,0,0);
+	_splitpath(dir,temp2,0,0,0);
+	if(lstrcmpi(temporary,temp2)!=0) return;
+
+	_splitpath(path,0,temporary,0,0);
+	_splitpath(dir,0,temp2,0,0);
+	i=1;i2=1;
+	while(1){
+		i4=i;
+		if(temporary[i-1]=='\\'&&temporary[i]){	//path側
+			for(i3=0;;i++,i3++){
+				if(temporary[i]=='\\'){
+					temp3[i3]=0;
+					i++;
+					break;
+				}
+				temp3[i3]=temporary[i];
+			}
+		}
+		else temp3[0]=0;
+
+		i5=i2;
+		if(temp2[i2-1]=='\\'&&temp2[i2]){		//dir側
+			for(i3=0;;i2++,i3++){
+				if(temp2[i2]=='\\'){
+					temp4[i3]=0;
+					i2++;
+					break;
+				}
+				temp4[i3]=temp2[i2];
+			}
+		}
+		else temp4[0]=0;
+
+		if(temp3[0]=='\0'&&temp4[0]=='\0'){
+			lstrcpy(temp3,".\\");
+			break;
+		}
+
+		if(lstrcmpi(temp3,temp4)!=0){
+			for(i3=0;;i5++){
+				if(temp2[i5]=='\0') break;
+				if(temp2[i5]=='\\') i3++;
+			}
+			if(i3==0) lstrcpy(temp3,".\\");
+			else{
+				temp3[0]=0;
+				for(i2=0;i2<i3;i2++) lstrcat(temp3,"..\\");
+			}
+			lstrcat(temp3,temporary+i4);
+			break;
+		}
+	}
+	_splitpath(path,0,0,temporary,temp2);
+	lstrcat(temp3,temporary);
+	lstrcat(temp3,temp2);
+	lstrcpy(path,temp3);
+}
+
+std::string Directory::GetRelationalPath( const std::string &fullPath ) const
+{
+	char temp[1024];
+	lstrcpy( temp, fullPath.c_str() );
+	_GetRelationalPath( temp, path.c_str() );
+	return temp;
+}
