#include "stdafx.h" using namespace Jenga::Common; Directory::Directory( const std::string &path, bool isMake ) : path( path ) { if ( isMake ) { if (!::MakeSureDirectoryPathExists(path.c_str())) { Jenga::Throw( "MakeSureDirectoryPathExists failed!" ); } } } std::string Directory::GetFullPath( const std::string &relationPath ) { std::string resultPath = relationPath; // '/'→'\' BOOST_FOREACH( char &c, resultPath ) { if( c == '/' ) { c = '\\'; } } if( resultPath.find( ":" ) != std::string::npos || resultPath.find( "\\\\" ) != std::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