Changeset 620 in dev
- Timestamp:
- May 19, 2008, 6:17:02 PM (17 years ago)
- Location:
- trunk/ab5.0
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/CFileInfo.cpp
r618 r620 13 13 void CFileInfo::GetFullPath(char *buffer){ 14 14 lstrcpy(buffer,m_path); 15 ::GetFullPath(buffer,projectInfo.dir);15 lstrcpy( buffer, projectInfo.GetWorkDir().GetFullPath( buffer ).c_str() ); 16 16 } 17 17 -
trunk/ab5.0/abdev/abdev/Common.h
r619 r620 667 667 _int8 WriteBuffer_NonErrMsg(char *path,char *buffer,int length); 668 668 void GetRelationalPath(char *path,char *dir); 669 void GetFullPath(char *path,c har *dir);669 void GetFullPath(char *path,const char *dir); 670 670 void RemoveDirectoryStrong(const char *dirPath); 671 671 BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,_int8 IsOpen); 672 672 BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle); 673 673 int GetFileExtension(char *path); 674 HWND OpenFileWithExtension( char *OpenFileName);674 HWND OpenFileWithExtension( const std::string &filePath ); 675 675 BOOL SaveDocument(HWND hChild,char *SaveFileName); 676 676 BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath); … … 1092 1092 void AddIconType(int WndNum,int IconType); 1093 1093 void DeleteIconType(int WndNum); 1094 void NewIconEditWindow(c har *filepath);1094 void NewIconEditWindow(const char *filepath); 1095 1095 void SaveIconFile(char *filepath,HWND hwnd); 1096 1096 LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); -
trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp
r619 r620 118 118 } 119 119 120 char *reflexive_Include(char *buffer,char ***pppFilePath,int *pFileNum,c har *pDefaultDir){120 char *reflexive_Include(char *buffer,char ***pppFilePath,int *pFileNum,const char *pDefaultDir){ 121 121 extern HANDLE hHeap; 122 122 int i,i2,i3,i4,sw1,sw2,FileSize; … … 255 255 256 256 //参照ディレクトリ 257 c har *pDefaultDir;257 const char *pDefaultDir; 258 258 if( projectInfo.IsOpened() ) 259 pDefaultDir=projectInfo. dir;259 pDefaultDir=projectInfo.GetWorkDir().GetPath().c_str(); 260 260 else pDefaultDir=pj_editor_Dir; 261 261 -
trunk/ab5.0/abdev/abdev/DrawWindow.cpp
r618 r620 997 997 if(i2!=projectInfo.res.NumberOfBitmapRes){ 998 998 lstrcpy(temporary,projectInfo.res.pBitmapResInfo[i2].path); 999 GetFullPath(temporary,projectInfo.dir);999 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1000 1000 hImage=LoadImage(NULL,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE); 1001 1001 … … 1366 1366 lstrcpy(temporary,projectInfo.res.pIconResInfo[i2].path); 1367 1367 } 1368 GetFullPath(temporary,projectInfo.dir);1368 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1369 1369 hImage=LoadImage(NULL,temporary,IMAGE_ICON,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE); 1370 1370 if(hImage){ … … 1410 1410 lstrcpy(temporary,projectInfo.res.pBitmapResInfo[i2].path); 1411 1411 } 1412 GetFullPath(temporary,projectInfo.dir);1412 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1413 1413 hImage=LoadImage(NULL,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE); 1414 1414 if(hImage){ -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r619 r620 136 136 lstrcpy(path,temp3); 137 137 } 138 void GetFullPath(char *path,c har *dir){138 void GetFullPath(char *path,const char *dir){ 139 139 int i,i2,i3,i4; 140 140 char temporary[MAX_PATH]; … … 290 290 return FT_OTHER; 291 291 } 292 HWND OpenFileWithExtension(char *OpenFileName){ 292 HWND OpenFileWithExtension( const std::string &filePath ) 293 { 293 294 int i; 294 295 _int8 DocumentType; 296 297 // TODO: 298 char *OpenFileName = const_cast<char *>(filePath.c_str()); 295 299 296 300 i=GetFileExtension(OpenFileName); … … 348 352 349 353 if(projectInfo.ModifyOfMaterial){ 350 sprintf(temporary,"%s%s.wnd",projectInfo. dir,projectInfo.GetName().c_str());354 sprintf(temporary,"%s%s.wnd",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str()); 351 355 SaveWindowFile( temporary, projectInfo.windowInfos ); 352 356 -
trunk/ab5.0/abdev/abdev/FileTree.cpp
r618 r620 26 26 //絶対パス、相対パスを表示 27 27 lstrcpy(temporary,path); 28 GetFullPath(temporary,projectInfo.dir);28 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 29 29 SetDlgItemText(hwnd,IDC_USING_FILE,temporary); 30 30 SetDlgItemText(hwnd,IDC_DEFINED_FILE,path); … … 110 110 111 111 lstrcpy(temporary,path); 112 GetFullPath(temporary,projectInfo.dir);112 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 113 113 OpenFileWithExtension(temporary); 114 114 break; -
trunk/ab5.0/abdev/abdev/IconEditor.cpp
r613 r620 237 237 InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hColorDlg,NULL,0); 238 238 } 239 void NewIconEditWindow(c har *filepath){239 void NewIconEditWindow(const char *filepath){ 240 240 extern HINSTANCE hInst,hResInst; 241 241 extern HANDLE hHeap; -
trunk/ab5.0/abdev/abdev/MessageCallOperation.cpp
r618 r620 41 41 CallBackNameLen=lstrlen(pWindowInfo->CallBackName); 42 42 43 sprintf(temporary,"%s%s",projectInfo.dir,pWindowInfo->filepath); 44 buffer=ReadBuffer(temporary); 43 buffer = ReadBuffer( projectInfo.GetWorkDir().GetPath() + pWindowInfo->filepath ); 45 44 46 45 *num=0; … … 138 137 WindowInfo *pWindowInfo = projectInfo.windowInfos[WndInfoNum]; 139 138 140 sprintf(temporary,"%s%s",projectInfo.dir,pWindowInfo->filepath); 141 hChild=OpenFileWithExtension(temporary); 139 hChild=OpenFileWithExtension( projectInfo.GetWorkDir().GetPath() + pWindowInfo->filepath ); 142 140 if(!hChild) return; 143 141 WndNum=GetWndNum(hChild); -
trunk/ab5.0/abdev/abdev/ParameterHint.cpp
r619 r620 36 36 //プロジェクトが開かれているとき 37 37 lstrcpy(temporary,projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->m_path); 38 GetFullPath(temporary,projectInfo.dir);38 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 39 39 40 40 extern MDIINFO MdiInfo[MAX_WNDNUM]; -
trunk/ab5.0/abdev/abdev/ProjectControl.cpp
r619 r620 137 137 lstrcpy(temporary, 138 138 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[pobj_ClassTreeView->pProcInfo[i].FileNum]->m_path); 139 GetFullPath(temporary,projectInfo.dir);139 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 140 140 hChild=OpenFileWithExtension(temporary); 141 141 } … … 194 194 if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){ 195 195 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path); 196 GetFullPath(temporary,projectInfo.dir);196 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 197 197 NewIconEditWindow(temporary); 198 198 break; … … 649 649 char temporary[MAX_PATH],temp2[MAX_PATH]; 650 650 651 GetRelationalPath(path,projectInfo.dir);651 lstrcpy( path, projectInfo.GetWorkDir().GetRelationalPath( path ).c_str() ); 652 652 653 653 //重複チェック … … 1273 1273 temporary[i3]=temp2[i2]; 1274 1274 } 1275 GetFullPath(temporary,projectInfo.dir);1275 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1276 1276 hChild=OpenFileWithExtension(temporary); 1277 1277 WndNum=GetWndNum(hChild); … … 1355 1355 for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){ 1356 1356 if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){ 1357 GetFullPath(temp2,projectInfo.dir); 1358 NewIconEditWindow(temp2); 1357 NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() ); 1359 1358 break; 1360 1359 } … … 1448 1447 lstrcpy(temporary,temp2+i3+1); 1449 1448 temp2[i3]=0; 1450 GetFullPath(temporary,projectInfo.dir);1449 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1451 1450 sscanf(temp2,"%d",&i3); 1452 1451 … … 1477 1476 for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){ 1478 1477 if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){ 1479 GetFullPath(temp2,projectInfo.dir); 1480 NewIconEditWindow(temp2); 1478 NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() ); 1481 1479 break; 1482 1480 } … … 1591 1589 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){ 1592 1590 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path); 1593 GetFullPath(temporary,projectInfo.dir);1591 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1594 1592 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1; 1595 1593 } … … 1678 1676 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){ 1679 1677 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path); 1680 GetFullPath(temporary,projectInfo.dir);1678 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1681 1679 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){ 1682 1680 sprintf(buffer+i2,"icon,%s\r\n",projectInfo.res.pIconResInfo[i].path); … … 1730 1728 1731 1729 //保存 1732 sprintf(temporary,"%s%s.wrk",projectInfo. dir,projectInfo.GetName().c_str());1730 sprintf(temporary,"%s%s.wrk",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str()); 1733 1731 WriteBuffer(temporary,buffer,i2); 1734 1732 } … … 1763 1761 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){ 1764 1762 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path); 1765 GetFullPath(temporary,projectInfo.dir);1763 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1766 1764 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){ 1767 1765 SaveDocument(hChild,NULL); … … 1824 1822 1825 1823 //保存 1826 sprintf(temporary,"%s%s.pj",projectInfo. dir,projectInfo.GetName().c_str());1824 sprintf(temporary,"%s%s.pj",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str()); 1827 1825 WriteBuffer(temporary,buffer,i2); 1828 1826 … … 1854 1852 //保存(resource.ab) 1855 1853 lstrcpy(temporary,"resource.ab"); 1856 GetFullPath(temporary,projectInfo.dir);1854 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1857 1855 WriteBuffer(temporary,buffer,i2); 1858 1856 … … 1886 1884 //保存 1887 1885 lstrcpy(temporary,projectInfo.ResourceFileName); 1888 GetFullPath(temporary,projectInfo.dir);1886 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1889 1887 WriteBuffer(temporary,buffer,i2); 1890 1888 } … … 1972 1970 1973 1971 //保存 1974 sprintf(temporary,"%s%s.idx",projectInfo. dir,projectInfo.GetName().c_str());1972 sprintf(temporary,"%s%s.idx",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str()); 1975 1973 WriteBuffer(temporary,buffer,i2); 1976 1974 … … 1981 1979 //ウィンドウ関連ファイル(*.wnd)を作成、保存 1982 1980 if(projectInfo.ModifyOfMaterial){ 1983 sprintf(temporary,"%s%s.wnd",projectInfo. dir,projectInfo.GetName().c_str());1981 sprintf(temporary,"%s%s.wnd",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str()); 1984 1982 SaveWindowFile( temporary, projectInfo.windowInfos ); 1985 1983 } … … 2035 2033 if(bDebug) lstrcpy(temporary,projectInfo.lpszOutput_Debug); 2036 2034 else lstrcpy(temporary,projectInfo.lpszOutput_Release); 2037 GetFullPath(temporary,projectInfo.dir);2035 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 2038 2036 2039 2037 hFind=FindFirstFile(temporary,&wfd); … … 2059 2057 //CallBack.wbp 2060 2058 lstrcpy(temporary,"CallBack.wbp"); 2061 GetFullPath(temporary,projectInfo.dir);2059 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 2062 2060 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 2063 2061 GetFileTime(hFile,NULL,NULL,&SourceTime); … … 2069 2067 //MakeWindow.wbp 2070 2068 lstrcpy(temporary,"MakeWindow.wbp"); 2071 GetFullPath(temporary,projectInfo.dir);2069 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 2072 2070 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 2073 2071 GetFileTime(hFile,NULL,NULL,&SourceTime); -
trunk/ab5.0/abdev/abdev/RadSupport.cpp
r618 r620 114 114 } 115 115 if(temporary[0]){ 116 GetFullPath(temporary,projectInfo.dir);116 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 117 117 lphImage[i2]=LoadImage(hInst,temporary,IMAGE_ICON,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE); 118 118 … … 132 132 } 133 133 if(temporary[0]){ 134 GetFullPath(temporary,projectInfo.dir);134 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 135 135 lphImage[i2]=LoadImage(hInst,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE); 136 136 -
trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp
r618 r620 2953 2953 Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo); 2954 2954 2955 GetRelationalPath(temporary,projectInfo.dir);2955 lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() ); 2956 2956 HeapDefaultFree(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path); 2957 2957 pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1); -
trunk/ab5.0/abdev/abdev/Resource.cpp
r619 r620 18 18 19 19 lstrcpy(temporary,projectInfo.ResourceFileName); 20 GetFullPath(temporary,projectInfo.dir);20 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 21 21 22 22 hFile=CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); … … 144 144 if(!GetFilePathDialog(hOwner,temporary,CursorFileFilter,STRING_FILEOPENTITLE_CURSOR,TRUE)) return; 145 145 146 GetRelationalPath(temporary,projectInfo.dir);146 lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() ); 147 147 148 148 projectInfo.res.pCursorResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pCursorResInfo,(projectInfo.res.NumberOfCursorRes+1)*sizeof(RESITEMINFO)); … … 248 248 if(!GetFilePathDialog(hOwner,temporary,BitmapFileFilter,STRING_FILEOPENTITLE_BITMAP,TRUE)) return; 249 249 250 GetRelationalPath(temporary,projectInfo.dir);250 lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() ); 251 251 252 252 projectInfo.res.pBitmapResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pBitmapResInfo,(projectInfo.res.NumberOfBitmapRes+1)*sizeof(RESITEMINFO)); … … 362 362 if(!GetFilePathDialog(hOwner,temporary,IconFileFilter,STRING_FILEOPENTITLE_ICON,TRUE)) return; 363 363 364 GetRelationalPath(temporary,projectInfo.dir);364 lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() ); 365 365 366 366 projectInfo.res.pIconResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pIconResInfo,(projectInfo.res.NumberOfIconRes+1)*sizeof(RESITEMINFO)); -
trunk/ab5.0/abdev/abdev/WindowControl.cpp
r619 r620 1513 1513 /////////////////////// 1514 1514 // 保存(Callback.wbp) 1515 sprintf(temporary,"%sCallback.wbp",projectInfo. dir);1515 sprintf(temporary,"%sCallback.wbp",projectInfo.GetWorkDir().GetPath().c_str() ); 1516 1516 WriteBuffer(temporary,buffer,i2); 1517 1517 … … 1600 1600 ///////////////////////// 1601 1601 // 保存(MakeWindow.wbp) 1602 sprintf(temporary,"%sMakeWindow.wbp",projectInfo. dir);1602 sprintf(temporary,"%sMakeWindow.wbp",projectInfo.GetWorkDir().GetPath().c_str()); 1603 1603 WriteBuffer(temporary,buffer,i2); 1604 1604 HeapDefaultFree(buffer); … … 2287 2287 NewWindow.CallBackName); 2288 2288 2289 sprintf(temporary,"%s%s.ab",projectInfo. dir,projectInfo.windowInfos.back()->GetName().c_str());2289 sprintf(temporary,"%s%s.ab",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.windowInfos.back()->GetName().c_str()); 2290 2290 2291 2291 //書き込み -
trunk/ab5.0/abdev/abdev/abdev.vcproj
r615 r620 78 78 <Tool 79 79 Name="VCLinkerTool" 80 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib "80 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib" 81 81 OutputFile="../TheText/TheText.exe" 82 82 LinkIncremental="1" … … 176 176 <Tool 177 177 Name="VCLinkerTool" 178 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib "178 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib" 179 179 OutputFile="$(OutDir)\abdev.exe" 180 180 LinkIncremental="2" … … 275 275 <Tool 276 276 Name="VCLinkerTool" 277 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib "277 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib" 278 278 OutputFile="$(OutDir)\abdev.exe" 279 279 LinkIncremental="1" … … 373 373 <Tool 374 374 Name="VCLinkerTool" 375 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib "375 AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib imagehlp.lib" 376 376 OutputFile="../TheText/TheText.exe" 377 377 LinkIncremental="2" -
trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
r619 r620 8 8 public: 9 9 10 Project() 11 : workDir( "" ) 12 { 13 } 14 10 15 void Open( char *path ); 11 16 bool Close(); … … 14 19 { 15 20 return name; 21 } 22 23 const Jenga::Common::Directory &GetWorkDir() const 24 { 25 return workDir; 16 26 } 17 27 … … 25 35 return moduleType; 26 36 } 27 28 char dir[MAX_PATH];29 37 30 38 DWORD dwVersion; … … 63 71 private: 64 72 std::string name; 73 Jenga::Common::Directory workDir; 65 74 ActiveBasic::Common::TargetModuleType::EnumType moduleType; 66 75 }; -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r619 r620 446 446 lstrcpy(temporary,NewFileName); 447 447 if(!strstr(temporary,".")) lstrcat(temporary,".ab"); 448 GetFullPath(temporary,projectInfo.dir); 448 449 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 449 450 } 450 451 else bAddToProject=0; … … 521 522 void MainFrame::OnCmdProjectFolderOpen( UINT uNotifyCode, int nID, CWindow wndCtl ) 522 523 { 523 ShellExecute(m_hWnd,"explore",projectInfo. dir,NULL,NULL,SW_SHOWNORMAL);524 ShellExecute(m_hWnd,"explore",projectInfo.GetWorkDir().GetPath().c_str(),NULL,NULL,SW_SHOWNORMAL); 524 525 } 525 526 … … 952 953 //出力ファイル名をtemp3へ 953 954 lstrcpy(temp3,projectInfo.lpszOutput_Debug); 954 GetFullPath(temp3,projectInfo.dir);955 lstrcpy( temp3, projectInfo.GetWorkDir().GetFullPath( temp3 ).c_str() ); 955 956 956 957 if(IsNeedCompileForProject(1)) … … 1030 1031 //出力ファイル名をtemp3へ 1031 1032 lstrcpy(temp3,projectInfo.lpszOutput_Debug); 1032 GetFullPath(temp3,projectInfo.dir);1033 lstrcpy( temp3, projectInfo.GetWorkDir().GetFullPath( temp3 ).c_str() ); 1033 1034 1034 1035 sprintf(temporary,"\"%s\" \"%s\" /debug /wnd:%08x",temp2,temp3,m_hWnd); … … 1144 1145 //出力ファイル名をtemp3へ 1145 1146 lstrcpy(temp3,projectInfo.lpszOutput_Release); 1146 GetFullPath(temp3,projectInfo.dir);1147 lstrcpy( temp3, projectInfo.GetWorkDir().GetFullPath( temp3 ).c_str() ); 1147 1148 1148 1149 sprintf(temporary,"\"%s\" \"%s\" /wnd:%08x",temp2,temp3,m_hWnd); … … 1208 1209 else{ 1209 1210 lstrcpy(temporary,projectInfo.lpszOutput_Debug); 1210 GetFullPath(temporary,projectInfo.dir);1211 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1211 1212 } 1212 1213 } -
trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
r619 r620 18 18 19 19 //プロジェクトの作業ディレクトリを取得 20 _splitpath(path,this->dir,temporary,0,0); 21 lstrcat(this->dir,temporary); 20 _splitpath(path,temporary,temp2,0,0); 21 lstrcat( temporary, temp2 ); 22 this->workDir = Jenga::Common::Directory( temporary ); 22 23 23 24 //ファイルを開く、保存の初期ディレクトリをセット 24 lstrcpy(pobj_nv->DefSaveDir,this-> dir);25 lstrcpy(pobj_nv->DefSaveDir,this->GetWorkDir().GetPath().c_str()); 25 26 26 27 … … 253 254 ///////////////////////////////////////////// 254 255 //ウィンドウ定義ファイル(*.wnd)をオープン 255 sprintf(temp2,"%s%s.wnd",this-> dir,this->GetName().c_str());256 sprintf(temp2,"%s%s.wnd",this->GetWorkDir().GetPath().c_str(),this->GetName().c_str()); 256 257 if(!OpenWindowFile(temp2)) return; 257 258 } … … 263 264 } 264 265 265 OpenWorkfile( this-> dir+ this->GetName() + ".wrk" );266 OpenWorkfile( this->GetWorkDir().GetPath() + this->GetName() + ".wrk" ); 266 267 267 268 this->modify=0; … … 324 325 for(i=0;this->res.NumberOfIconRes;i++){ 325 326 lstrcpy(temporary,this->res.pIconResInfo[i].path); 326 GetFullPath(temporary,this->dir);327 lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() ); 327 328 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){ 328 329 SendMessage(hCloseChild,WM_CLOSE,0,0); -
trunk/ab5.0/jenga/include/common/Directory.h
r523 r620 9 9 public: 10 10 Directory( const std::string &path, bool isMake = false ); 11 Directory( const Directory &dir ); 11 12 12 std::string GetFullPath( const std::string &relationPath ); 13 const std::string &GetPath() const 14 { 15 return path; 16 } 17 18 std::string GetFullPath( const std::string &relationPath ) const; 19 std::string GetRelationalPath( const std::string &fullPath ) const; 13 20 }; 14 21 -
trunk/ab5.0/jenga/src/common/Directory.cpp
r523 r620 14 14 } 15 15 } 16 Directory::Directory( const Directory &dir ) 17 : path( dir.path ) 18 { 19 } 16 20 17 std::string Directory::GetFullPath( const std::string &relationPath ) 21 std::string Directory::GetFullPath( const std::string &relationPath ) const 18 22 { 19 23 std::string resultPath = relationPath; … … 61 65 return temporary; 62 66 } 67 68 void _GetRelationalPath(char *path,const char *dir){ 69 //相対パスを取得 70 int i,i2,i3,i4,i5; 71 char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH],temp4[MAX_PATH]; 72 73 //ドライブ名をチェック 74 _splitpath(path,temporary,0,0,0); 75 _splitpath(dir,temp2,0,0,0); 76 if(lstrcmpi(temporary,temp2)!=0) return; 77 78 _splitpath(path,0,temporary,0,0); 79 _splitpath(dir,0,temp2,0,0); 80 i=1;i2=1; 81 while(1){ 82 i4=i; 83 if(temporary[i-1]=='\\'&&temporary[i]){ //path側 84 for(i3=0;;i++,i3++){ 85 if(temporary[i]=='\\'){ 86 temp3[i3]=0; 87 i++; 88 break; 89 } 90 temp3[i3]=temporary[i]; 91 } 92 } 93 else temp3[0]=0; 94 95 i5=i2; 96 if(temp2[i2-1]=='\\'&&temp2[i2]){ //dir側 97 for(i3=0;;i2++,i3++){ 98 if(temp2[i2]=='\\'){ 99 temp4[i3]=0; 100 i2++; 101 break; 102 } 103 temp4[i3]=temp2[i2]; 104 } 105 } 106 else temp4[0]=0; 107 108 if(temp3[0]=='\0'&&temp4[0]=='\0'){ 109 lstrcpy(temp3,".\\"); 110 break; 111 } 112 113 if(lstrcmpi(temp3,temp4)!=0){ 114 for(i3=0;;i5++){ 115 if(temp2[i5]=='\0') break; 116 if(temp2[i5]=='\\') i3++; 117 } 118 if(i3==0) lstrcpy(temp3,".\\"); 119 else{ 120 temp3[0]=0; 121 for(i2=0;i2<i3;i2++) lstrcat(temp3,"..\\"); 122 } 123 lstrcat(temp3,temporary+i4); 124 break; 125 } 126 } 127 _splitpath(path,0,0,temporary,temp2); 128 lstrcat(temp3,temporary); 129 lstrcat(temp3,temp2); 130 lstrcpy(path,temp3); 131 } 132 133 std::string Directory::GetRelationalPath( const std::string &fullPath ) const 134 { 135 char temp[1024]; 136 lstrcpy( temp, fullPath.c_str() ); 137 _GetRelationalPath( temp, path.c_str() ); 138 return temp; 139 }
Note:
See TracChangeset
for help on using the changeset viewer.