Changeset 717 in dev for trunk/ab5.0
- Timestamp:
- Aug 13, 2008, 10:33:58 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/NonVolatile.cpp
r523 r717 105 105 106 106 //開く 107 buffer=ReadBuffer_NonErrMsg( Jenga::Common::Environment::GetAppDir() + "\\UserSetting\\compiler.ini" );107 buffer=ReadBuffer_NonErrMsg( Program::GetUserAppDir() + "\\compiler.ini" ); 108 108 if(!buffer){ 109 109 //レジストリを読み込む … … 247 247 char temporary[MAX_PATH]; 248 248 249 const std::string userSettingDirPath = Jenga::Common::Environment::GetAppDir() + "\\UserSetting"; 250 251 HANDLE hFind; 252 WIN32_FIND_DATA wfd; 253 hFind=FindFirstFile( userSettingDirPath.c_str() ,&wfd); 254 if(hFind==INVALID_HANDLE_VALUE){ 255 //UserSettingディレクトリを作成 256 if(!CreateDirectory( userSettingDirPath.c_str() ,NULL)){ 257 extern HWND hOwnerEditor; 258 MessageBox(hOwnerEditor,"UserSettingディレクトリの作成に失敗","ActiveBasic",MB_OK|MB_ICONEXCLAMATION); 259 return; 260 } 261 } 249 // ユーザ情報保存用のディレクトリを作成 250 Jenga::Common::Directory dir( Program::GetUserAppDir(), true ); 251 262 252 263 253 extern HANDLE hHeap; … … 286 276 //保存 287 277 WriteBuffer( 288 userSettingDirPath+ "\\compiler.ini",278 Program::GetUserAppDir() + "\\compiler.ini", 289 279 buffer,lstrlen(buffer)); 290 280 -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h
r636 r717 30 30 31 31 bool AnalysisCommandLines(); 32 33 // ユーザデータ格納用のディレクトリを取得 34 static const std::string GetUserAppDir(); 32 35 33 36 const std::string &GetSourceFilePath() const -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp
r697 r717 139 139 } 140 140 141 const std::string Program::GetUserAppDir() 142 { 143 return Jenga::Common::Environment::GetUserAppDir() + "\\ActiveBasic\\abc"; 144 } 145 141 146 int Program::GetExitCode() const 142 147 { -
trunk/ab5.0/abdev/abdev/Common.h
r700 r717 620 620 621 621 //FileOperation.cpp 622 void MakeUserSettingDir(void);623 622 char *ReadBuffer( const std::string &path ); 624 623 char *ReadBuffer_NonErrMsg( const std::string &path ); … … 843 842 ~CHistory(); 844 843 845 void load( char *path);846 void save( char *path);844 void load( const std::string &path ); 845 void save( const std::string &path ); 847 846 848 847 void add(char *path); -
trunk/ab5.0/abdev/abdev/DialogBoxes.cpp
r629 r717 1123 1123 1124 1124 pobj_nv->bSaveWebFindStr=temp_bSaveWebFindStr; 1125 1126 //Web検索1127 pobj_nv->pobj_DBDomain->copy_get(pobj_temp_DBDomain);1128 1125 1129 1126 //SideWebウィンドウを再表示 -
trunk/ab5.0/abdev/abdev/ExtensionLink.cpp
r625 r717 35 35 } 36 36 37 void CExtLink::load(char *path){ 37 void CExtLink::load( const std::string &path ) 38 { 38 39 char *buffer; 39 40 buffer=ReadBuffer_NonErrMsg(path); … … 82 83 } 83 84 } 84 void CExtLink::save(char *path){ 85 void CExtLink::save( const std::string &path ) 86 { 85 87 int i; 86 88 char buffer[8192]; -
trunk/ab5.0/abdev/abdev/ExtensionLink.h
r625 r717 21 21 ~CExtLink(); 22 22 23 void load( char *path);24 void save( char *path);23 void load( const std::string &path ); 24 void save( const std::string &path ); 25 25 26 26 BOOL add(BOOL bReg,char *lpszExtension,char *lpszNote,BOOL bWindowsSearch,COLORREF tab_color); -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r705 r717 2 2 3 3 #include "Common.h" 4 5 void MakeUserSettingDir(void){6 char temporary[MAX_PATH];7 sprintf(temporary,"%sUserSetting",pj_editor_Dir);8 9 HANDLE hFind;10 WIN32_FIND_DATA wfd;11 hFind=FindFirstFile(temporary,&wfd);12 if(hFind==INVALID_HANDLE_VALUE){13 //UserSettingディレクトリを作成14 if(!CreateDirectory(temporary,NULL)){15 MessageBox(hOwner,"UserSettingディレクトリの作成に失敗",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);16 return;17 }18 }19 else{20 FindClose(hFind);21 }22 }23 4 24 5 char *ReadBuffer( const std::string &path ){ -
trunk/ab5.0/abdev/abdev/History.cpp
r631 r717 16 16 } 17 17 18 void CHistory::load(char *path){ 18 void CHistory::load( const std::string &path ) 19 { 19 20 char temporary[MAX_PATH]; 20 21 … … 38 39 } 39 40 } 40 void CHistory::save(char *path){ 41 void CHistory::save( const std::string &path ) 42 { 41 43 char *buffer; 42 44 buffer=(char *)HeapAlloc(hHeap,0,iNum*MAX_PATH+1); -
trunk/ab5.0/abdev/abdev/NonVolatile.cpp
r480 r717 235 235 char temporary[MAX_PATH]; 236 236 237 std::string userAppDir = ActiveBasic::IDE::Program::GetUserAppDir(); 238 237 239 238 240 /////////////////////////////////// 239 241 // 関連付け用の拡張子オブジェクト 240 242 /////////////////////////////////// 241 sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir); 242 pobj_ExtLink->load(temporary); 243 244 245 ////////////////////////////////////// 246 // Web検索用ドメイン管理オブジェクト 247 ////////////////////////////////////// 248 pobj_DBDomain->load(); 243 pobj_ExtLink->load( userAppDir + "\\extlink.ini" ); 249 244 250 245 … … 252 247 // 「最近使ったファイル」オブジェクト 253 248 /////////////////////////////////////// 254 sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir); 255 pobj_History->load(temporary); 249 pobj_History->load( userAppDir + "\\history.ini" ); 256 250 257 251 … … 259 253 // 「最近使ったプロジェクト」オブジェクト 260 254 //////////////////////////////////////////// 261 sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir); 262 pobj_ProjectHistory->load(temporary); 255 pobj_ProjectHistory->load( userAppDir + "\\pj_history.ini" ); 263 256 264 257 265 258 266 259 //開く 267 sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir); 268 buffer=ReadBuffer_NonErrMsg(temporary); 260 buffer=ReadBuffer_NonErrMsg( userAppDir + "\\editor.ini" ); 269 261 if(!buffer){ 270 262 … … 454 446 int i2,i3; 455 447 456 sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir); 457 buffer=ReadBuffer_NonErrMsg(temporary); 448 buffer=ReadBuffer_NonErrMsg( userAppDir + "\\findstr.ini" ); 458 449 if(buffer){ 459 450 i2=0; … … 476 467 // 置換文字列 477 468 ///////////////// 478 sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir); 479 buffer=ReadBuffer_NonErrMsg(temporary); 469 buffer=ReadBuffer_NonErrMsg( userAppDir + "\\permustr.ini" ); 480 470 if(buffer){ 481 471 i2=0; … … 498 488 // Web検索文字列 499 489 ///////////////// 500 sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir); 501 buffer=ReadBuffer_NonErrMsg(temporary); 490 buffer=ReadBuffer_NonErrMsg( userAppDir + "webstr.ini" ); 502 491 if(buffer){ 503 492 i2=0; … … 678 667 void CNonVolatile::save(){ 679 668 int i; 680 char temporary[MAX_PATH]; 681 682 sprintf(temporary,"%sUserSetting",pj_editor_Dir); 683 684 HANDLE hFind; 685 WIN32_FIND_DATA wfd; 686 hFind=FindFirstFile(temporary,&wfd); 687 if(hFind==INVALID_HANDLE_VALUE){ 688 //UserSettingディレクトリを作成 689 if(!CreateDirectory(temporary,NULL)){ 690 MessageBox(hOwner,"UserSettingディレクトリの作成に失敗",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); 691 return; 692 } 693 } 669 670 // ユーザ情報保存用のディレクトリを作成 671 Jenga::Common::Directory dir( ActiveBasic::IDE::Program::GetUserAppDir(), true ); 672 694 673 695 674 buffer=(char *)HeapAlloc(hHeap,0,65536); … … 827 806 828 807 808 std::string userAppDir = ActiveBasic::IDE::Program::GetUserAppDir(); 809 829 810 //保存 830 sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir); 831 WriteBuffer(temporary,buffer,lstrlen(buffer)); 811 WriteBuffer( userAppDir + "\\editor.ini", buffer,lstrlen(buffer)); 832 812 833 813 … … 845 825 846 826 //保存 847 sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir); 848 WriteBuffer(temporary,buffer,lstrlen(buffer)); 827 WriteBuffer( userAppDir + "\\findstr.ini", buffer,lstrlen(buffer)); 849 828 850 829 … … 862 841 863 842 //保存 864 sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir); 865 WriteBuffer(temporary,buffer,lstrlen(buffer)); 843 WriteBuffer( userAppDir + "\\permustr.ini", buffer,lstrlen(buffer)); 866 844 867 845 … … 879 857 880 858 //保存 881 sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir); 882 WriteBuffer(temporary,buffer,lstrlen(buffer)); 859 WriteBuffer( userAppDir + "\\webstr.ini", buffer,lstrlen(buffer)); 883 860 884 861 HeapDefaultFree(buffer); … … 889 866 // 関連付け用の拡張子オブジェクト 890 867 /////////////////////////////////// 891 sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir); 892 pobj_ExtLink->save(temporary); 893 894 895 ////////////////////////////////////// 896 // Web検索用ドメイン管理オブジェクト 897 ////////////////////////////////////// 898 pobj_DBDomain->save(); 868 pobj_ExtLink->save( userAppDir + "\\extlink.ini" ); 899 869 900 870 … … 902 872 // 「最近使ったファイル」オブジェクト 903 873 /////////////////////////////////////// 904 sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir); 905 pobj_History->save(temporary); 874 pobj_History->save( userAppDir + "\\history.ini" ); 906 875 907 876 … … 909 878 // 「最近使ったファイル」オブジェクト 910 879 /////////////////////////////////////// 911 sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir); 912 pobj_ProjectHistory->save(temporary); 913 } 880 pobj_ProjectHistory->save( userAppDir + "\\pj_history.ini" ); 881 } -
trunk/ab5.0/abdev/abdev/include/Program.h
r681 r717 16 16 static const WindowComponents::CodeEditor::Language *ablang; 17 17 18 // ユーザデータ格納用のディレクトリを取得 19 static const std::string GetUserAppDir(); 20 18 21 static void Main(); 19 22 -
trunk/ab5.0/abdev/abdev/src/Program.cpp
r681 r717 27 27 } 28 28 29 const std::string Program::GetUserAppDir() 30 { 31 return Jenga::Common::Environment::GetUserAppDir() + "\\ActiveBasic\\ide"; 32 } 33 29 34 void Program::Main() 30 35 {
Note:
See TracChangeset
for help on using the changeset viewer.