OSDN Git Service

2012/01/26 17:30:46
authorunknown <qwerty2501@users.sourceforge.jp>
Thu, 26 Jan 2012 08:30:46 +0000 (17:30 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Thu, 26 Jan 2012 08:30:46 +0000 (17:30 +0900)
13 files changed:
nlite.suo
nlite/nlite.cpp
nlite/nlite_appInfo.cpp
nlite/nlite_commentview.cpp
nlite/nlite_exception.cpp
nlite/nlite_exception.h
nlite/nlite_mainframe.cpp
nlite/nlite_nlib.cpp
nlite/nlite_property.cpp
nlite/nlite_property.h
nlite/nlite_string.cpp
nlite/nlite_string.h
nlite/stdafx.h

index 881659f..45c0816 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index cedcb25..800bb20 100644 (file)
@@ -30,11 +30,11 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
                InitCommonControls();
 
                if(_Module.Init(NULL, hInstance) != S_OK){
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
                        
                if(InitializeNlite() != TRUE){
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
                
                
@@ -63,15 +63,14 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
                
        } catch(nlite::Exception &e){
                
+               UnexpectedErrorMessageShow(TEXT("\83n\83\93\83h\83\8b\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81["),e.what(),e.getLineNo(),e.getFileName(),e.getFunctionName());
                
-               MessageBox(NULL,e.what(),TEXT("\83n\83\93\83h\83\8b\82³\82ê\82Ä\82È\82¢\83G\83\89\81["),MB_ICONERROR | MB_OK);
-               errprint(TEXT(NLITE_ERR_MESSAGE_FORMAT),e.what(),e.getLineNo(),e.getFileName());
 
                goto nlitefinally;
        }catch(std::exception &e){
-               
-               MessageBoxA(NULL,e.what(),"\83n\83\93\83h\83\8b\82³\82ê\82Ä\82È\82¢\95s\96¾\82Ì\83G\83\89\81[",MB_ICONERROR | MB_OK);
                errprint_mb(CP_THREAD_ACP,NLITE_ERR_MESSAGE_FORMAT,e.what(),__LINE__,__FILE__);
+               MessageBoxA(NULL,e.what(),"\83n\83\93\83h\83\8b\82³\82ê\82Ä\82È\82¢\95s\96¾\82Ì\83G\83\89\81[",MB_ICONERROR | MB_OK);
+               
 
                goto nlitefinally;
        } 
@@ -114,7 +113,7 @@ static BOOL InitializeNlite(){
                
                if(err != ERROR_SUCCESS){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
                const CApplicationInfo &appInfo = CApplicationInfo::getInstance();
@@ -128,7 +127,7 @@ static BOOL InitializeNlite(){
 
                if(hInternet == NULL){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
@@ -136,7 +135,7 @@ static BOOL InitializeNlite(){
 
                if(SHGetFolderPathW(0,CSIDL_LOCAL_APPDATA,0,SHGFP_TYPE_CURRENT,localAppDataPath) != S_OK){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
 
@@ -169,13 +168,13 @@ static BOOL InitializeNlite(){
  }
 
  VOID nlite::UnexpectedErrorMessageShow(LPCTSTR headMessage,LPCTSTR summary,UINT line,LPCTSTR fileName,LPCTSTR function){
-       CNLiteString errMessage;
+       tstring errMessage;
        errMessage = headMessage;
        errMessage += TEXT("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81[\82ª\94­\90\82µ\82Ü\82µ\82½\81B\83A\83v\83\8a\83P\81[\83V\83\87\83\93\94z\92u\83t\83H\83\8b\83_\82É\8dì\90¬\82³\82ê\82½\83\8d\83O\83t\83@\83C\83\8b\82ð\93n\82µ\82Ä\82à\82ç\82¦\82é\82Æ\8aJ\94­\8eÒ\82ª\94ñ\8fí\82É\8aì\82Ñ\82Ü\82·");
        errMessage += TEXT("\r\n\83G\83\89\81[\83\81\83b\83Z\81[\83W:");
        errMessage += summary;
        DebugOutW(fileName,function,line,DUMPING__DEBUGER__ | LINEFEAD__DEBUGER__ ,ERRORMODE__DEBUGER__,TEXT("%s"),errMessage);
-       ::MessageBox(NULL,errMessage,TEXT("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81["),MB_ICONERROR | MB_OK);
+       ::MessageBox(NULL,errMessage.c_str(),TEXT("\91z\92è\82³\82ê\82Ä\82¢\82È\82¢\83G\83\89\81["),MB_ICONERROR | MB_OK);
        
 
 
index c79d786..8cb9324 100644 (file)
@@ -24,7 +24,7 @@ CApplicationInfo::CApplicationInfo(){
                if(nRet <= 0){
 
                        
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
 
@@ -34,7 +34,7 @@ CApplicationInfo::CApplicationInfo(){
 
                if(dwSize <= 0){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
                pBlock = malloc(dwSize);
@@ -45,12 +45,12 @@ CApplicationInfo::CApplicationInfo(){
                assert(bRet);
 
                if(bRet != TRUE){
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
                UINT ulen;
                if(VerQueryValue(pBlock,TEXT("\\VarFileInfo\\Translation"),(LPVOID*)&lpTranslate,&ulen) == FALSE){
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
                TCHAR subBlock[_MAX_PATH];
@@ -58,7 +58,7 @@ CApplicationInfo::CApplicationInfo(){
 
                if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pProductVersion,&ulen) == FALSE){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
@@ -66,7 +66,7 @@ CApplicationInfo::CApplicationInfo(){
 
                if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pOriginalFileName,&ulen) == FALSE){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
@@ -74,7 +74,7 @@ CApplicationInfo::CApplicationInfo(){
 
                if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pLegalCopyright,&ulen) == FALSE){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
@@ -82,7 +82,7 @@ CApplicationInfo::CApplicationInfo(){
 
                if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pProductName,&ulen) == FALSE){
 
-                       throw AppInitException(__LINE__,TEXT(__FILE__));
+                       throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
index f723823..e95c9d2 100644 (file)
@@ -858,8 +858,8 @@ overclientrect:
                dc.LineTo(timeViewRect.right,rc.bottom);
 
                dc.DrawTextW(noString,_tcslen(noString),&noViewRect,DT_WORD_ELLIPSIS);
-               dc.DrawTextW(chatData.listenerData->user_id,chatData.listenerData->user_id.GetLength(),&userNameViewRect,DT_WORD_ELLIPSIS);
-               dc.DrawTextW(chatData.chatBuf,chatData.chatBuf.GetLength(),&chatViewRect,DT_WORDBREAK);
+               dc.DrawTextW(chatData.listenerData->user_id,chatData.listenerData->user_id.Length(),&userNameViewRect,DT_WORD_ELLIPSIS);
+               dc.DrawTextW(chatData.chatBuf,chatData.chatBuf.Length(),&chatViewRect,DT_WORDBREAK);
                dc.DrawTextW(dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS);
 
                return;
@@ -877,7 +877,7 @@ overclientrect:
 
                CPaintDC pdc(*this);
                pdc.SelectFont(AtlGetDefaultGuiFont());
-               ::DrawTextW(pdc,chatData.chatBuf,chatData.chatBuf.GetLength(),&drowSize, DT_CALCRECT | DT_WORDBREAK);
+               ::DrawTextW(pdc,chatData.chatBuf,chatData.chatBuf.Length(),&drowSize, DT_CALCRECT | DT_WORDBREAK);
                drowSize.top -= 2;
                drowSize.bottom += 2;
 
index 837753b..e403eaf 100644 (file)
@@ -7,9 +7,10 @@ Exception::Exception(){}
 
 Exception::Exception(const char* const& errMessage):exception(errMessage){}
 
-Exception::Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName):
+Exception::Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function):
        wErrMessage(errMessage),
-       line(in_line)
+       line(in_line),
+       function(in_function)
 {
        WCHAR file[_MAX_FNAME];
        WCHAR ext[_MAX_EXT];
@@ -19,7 +20,7 @@ Exception::Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR
 
 }
 
-LPCWSTR Exception::what(){
+LPCTSTR Exception::what(){
 
        return wErrMessage;
 
@@ -30,19 +31,24 @@ UINT_PTR Exception::getLineNo(){
        return line;
 }
 
-LPCWSTR Exception::getFileName(){
+LPCTSTR Exception::getFileName(){
                        
        return fileName;
                
 }
 
+LPCTSTR Exception::getFunctionName(){
 
-AppInitException::AppInitException(UINT_PTR in_line,LPCTSTR in_fileName):Exception(TEXT("\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»\82É\8e¸\94s\82µ\82Ü\82µ\82½"),in_line,in_fileName){}
+       return function;
+}
+
+
+AppInitException::AppInitException(UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function):Exception(TEXT("\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»\82É\8e¸\94s\82µ\82Ü\82µ\82½"),in_line,in_fileName,in_function){}
 
 
 
-NLIBException::NLIBException(LPCTSTR errmessage,NLIB_RESULT rslt,UINT_PTR in_line,LPCTSTR in_fileName):errcode(rslt),Exception(errmessage,in_line,in_fileName){}
+NLIBException::NLIBException(LPCTSTR errmessage,NLIB_RESULT rslt,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function):errcode(rslt),Exception(errmessage,in_line,in_fileName,in_function){}
 
-NLiveException::NLiveException(LPCTSTR errmessage,UINT_PTR in_line,LPCTSTR in_fileName):Exception(errmessage,in_line,in_fileName){}
+NLiveException::NLiveException(LPCTSTR errmessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function):Exception(errmessage,in_line,in_fileName,in_function){}
 
 }
\ No newline at end of file
index c5af81f..ac0bcab 100644 (file)
@@ -10,6 +10,7 @@ namespace nlite{
                CNLiteString  wErrMessage;
                UINT_PTR line;
                CNLiteString fileName;
+               CNLiteString function;
 
                
        public:
@@ -18,13 +19,13 @@ namespace nlite{
                ///
                Exception();
                Exception(const char* const& errMessage);
-               Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName);
+               Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
                
                
                ///
                ///\83G\83\89\81[\95\8c¾\8eæ\93¾
                ///
-               LPCWSTR what();
+               LPCTSTR what();
 
 
                ///
@@ -35,7 +36,13 @@ namespace nlite{
                ///
                ///\83G\83\89\81[\94­\90\83t\83@\83C\83\8b\96¼\8eæ\93¾
                ///
-               LPCWSTR getFileName();
+               LPCTSTR getFileName();
+
+
+               ///
+               ///\83G\83\89\81[\94­\90\8aÖ\90\94\96¼\82ð\8eæ\93¾
+               ///
+               LPCTSTR getFunctionName();
 
        };
 
@@ -48,7 +55,7 @@ namespace nlite{
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
                ///
-               AppInitException(UINT_PTR in_line,LPCTSTR in_fileName);
+               AppInitException(UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
        };
 
 
@@ -62,7 +69,7 @@ namespace nlite{
                NLIB_RESULT errcode;
 
        public:
-               NLIBException(LPCTSTR errmessage,NLIB_RESULT rslt,UINT_PTR in_line,LPCTSTR in_fileName);
+               NLIBException(LPCTSTR errmessage,NLIB_RESULT rslt,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
                
        
 
@@ -78,7 +85,7 @@ namespace nlite{
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
                ///
-               NLiveException(LPCTSTR errmessage,UINT_PTR in_line,LPCTSTR in_fileName);
+               NLiveException(LPCTSTR errmessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
                
 
        };
index e0f878e..d596037 100644 (file)
@@ -181,7 +181,7 @@ LRESULT CNliteMainFrame::OnCreate(LPCREATESTRUCT lpcs){
 
 VOID CNliteMainFrame::Initialize(LPCTSTR localAppDataPath){
 
-       nliteProperty.ReadIniFile();
+       nliteProperty.ReadProperty();
 
        commentView.SetProperty(nliteProperty.cvp);
 
@@ -236,7 +236,7 @@ VOID CNliteMainFrame::OnMenuAbount(UINT uNotifyCode,int nID,HWND hWndCtl){
 VOID CNliteMainFrame::Finalaize(){
 
        nliteProperty.cvp = commentView.GetProperty();
-       nliteProperty.WriteIniFile();
+       nliteProperty.WriteProperty();
 }
 
 //\83N\83b\83L\81[\82Ì\90Ý\92è
@@ -413,13 +413,13 @@ NLIB_RESULT CNliteMainFrame::LiveCallBack(NICOLIVE_EVENT eventType,NicoLiveStrea
 
                case NICOLIVE_EVENT_ERR_CONNECT:
 
-                       throw NLiveException(TEXT("\90Ú\91±\83G\83\89\81[\82Å\82·"),__LINE__,TEXT(__FILE__));
+                       throw NLiveException(TEXT("\90Ú\91±\83G\83\89\81[\82Å\82·"),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                        break;
 
                default:
 
-                       throw NLiveException(TEXT("\97\\8aú\82µ\82È\82¢\83\81\83b\83Z\81[\83W\82ª\91\97\90M\82³\82ê\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__));
+                       throw NLiveException(TEXT("\97\\8aú\82µ\82È\82¢\83\81\83b\83Z\81[\83W\82ª\91\97\90M\82³\82ê\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                        break;
                }
index b38197c..45c2123 100644 (file)
@@ -56,7 +56,7 @@ VOID CNicoVideoAuth::SetBrowserType(BROWSERTYPE bt){
        rslt = NicoVideoAuth_getNicoVideoAuth(nicoVideoAuth,bt);
        if(rslt != NLIB_ERR_OK){
 
-               throw NLIBException(TEXT("\83j\83R\83j\83R\93®\89æ\94F\8fØ\8fî\95ñ\8eæ\93¾\82É\8e¸\94s\82µ\82Ü\82µ\82½"),rslt,__LINE__,TEXT(__FILE__));
+               throw NLIBException(TEXT("\83j\83R\83j\83R\93®\89æ\94F\8fØ\8fî\95ñ\8eæ\93¾\82É\8e¸\94s\82µ\82Ü\82µ\82½"),rslt,__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
        }
 
 }
@@ -66,7 +66,7 @@ VOID CNicoVideoAuth::SetBrowserType(BROWSERTYPE bt){
 
 BOOL CCommentMaker::SetChatString(LPCTSTR chatString){
        
-       if(this->chatString.GetLength() != 0)return FALSE;
+       if(this->chatString.Length() != 0)return FALSE;
        this->chatString = chatString;
 
        return TRUE;
index b9f7faa..cf1b21a 100644 (file)
@@ -14,6 +14,33 @@ namespace nlite{
 
 #define NLITE_WRITE_INI_STR(cs,mm,path)                WritePrivateProfileString(cs.GetSectionName(),TEXT(#mm),cs.mm,path)
 
+
+
+#define NLITE_XMLELLMENT_WRITE(s,p)            s->WriteStartElement(NULL, _tcsstr(CComBSTR(typeid(p).name()),TEXT("::")) + 2, NULL)
+
+#define NLITE_ATTRIBUTE_WRITE_STR(s,n) s->WriteAttributeString(NULL, _tcsstr(TEXT(#n),TEXT(".")) + 1, NULL, n)
+
+
+#define NLITE_ATTRIBUTE_WRITE_INT(s,n) \
+       {\
+       TCHAR buffer[sizeof(n) * 8];\
+       _stprintf(buffer,TEXT("%d"),static_cast<INT>(n));\
+       s->WriteAttributeString(NULL, _tcsstr(TEXT(#n),TEXT(".")) + 1, NULL,buffer );\
+}
+
+#define NLITE_XML_WRITE_FOR_INT(s,n)\
+       {\
+               TCHAR nbuffer[LENGTH_256];\
+               TCHAR buffer[sizeof(n[0]) * 8];\
+               for(UINT_PTR index = 0;index < ARRAY_LENGTH(n);index++){\
+                       _stprintf(nbuffer,TEXT("%s%d"),_tcsstr(TEXT(#n),TEXT(".")) + 1,index);\
+                       _stprintf(buffer,TEXT("%d"),n[index]);\
+                       s->WriteAttributeString(NULL, nbuffer, NULL,buffer );\
+               }\
+}
+
+
+
 static LPCTSTR headerFormat = TEXT("headerholSize%u");
 static LPCTSTR headerOrderFormat = TEXT("headerOrderArray%u");
 static const LPCTSTR bt_none = TEXT("none");
@@ -22,6 +49,8 @@ static const LPCTSTR bt_chrome = TEXT("chrome");
 static const LPCTSTR bt_firefox = TEXT("firefox");
 static const LPCTSTR bt_iecm = TEXT("iecm");
 
+
+
 static
 BOOL
 WINAPI
@@ -167,7 +196,7 @@ CommentReadProperty::CommentReadProperty():
        commentReadFlag(FALSE),
        ngWordReadFlag(TRUE),
        ngUserReadFlag(TRUE),
-       managementReadFlag(TRUE),
+       administratorCommentReadFlag(TRUE),
        bspReadFlag(TRUE),
        userCommentReadFlag(TRUE),
        teropReadFlag(TRUE),
@@ -180,7 +209,7 @@ CommentReadProperty::CommentReadProperty():
 GeneralProperty::GeneralProperty():
        userCountUpdateFlag(TRUE),
        commentLogAutoSaveFlag(FALSE),
-       defaultBroserFlag(TRUE),
+       defaultBrowserFlag(TRUE),
        autoNameRegisterFlag(FALSE),
        autoNameUpdateFlag(FALSE),
        numberNameFlag(FALSE),
@@ -238,10 +267,10 @@ BROWSERTYPE Property::CookieSetting(){
 
 }
 
-VOID Property::ReadIniFile(){
+VOID Property::ReadProperty(){
 
        CreatePropertyFile();
-
+       
        std::vector<TCHAR> buffer(LENGTH_2048);
        
        //crp\82Ì\90Ý\92è\92l\93Ç\82Ý\8d\9e\82Ý
@@ -252,7 +281,7 @@ VOID Property::ReadIniFile(){
 
        NLITE_READ_INI_INT(crp,commentReadFlag,propertyPath);
 
-       NLITE_READ_INI_INT(crp,managementReadFlag,propertyPath);
+       NLITE_READ_INI_INT(crp,administratorCommentReadFlag,propertyPath);
 
        NLITE_READ_INI_INT(crp,maxCommentLength,propertyPath);
 
@@ -286,7 +315,7 @@ VOID Property::ReadIniFile(){
        NLITE_READ_INI_INT(cvp,IDLinkColor,propertyPath);
 
        NLITE_READ_INI_INT(cvp,lineColor,propertyPath);
-
+       
        
        TCHAR headerKey[_MAX_PATH];
        TCHAR headerOrderKey[_MAX_PATH];
@@ -322,7 +351,7 @@ VOID Property::ReadIniFile(){
 
        NLITE_READ_INI_STR(gp,commentPath,buffer,propertyPath);
                        
-       NLITE_READ_INI_INT(gp,defaultBroserFlag,propertyPath);
+       NLITE_READ_INI_INT(gp,defaultBrowserFlag,propertyPath);
 
        NLITE_READ_INI_INT(gp,numberNameFlag,propertyPath);
 
@@ -349,7 +378,7 @@ VOID Property::ReadIniFile(){
 
                gp.browserType = it->second;
        }else{
-        throw AppInitException(__LINE__,TEXT(__FILE__));
+        throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
        }
 
        return;
@@ -365,7 +394,7 @@ VOID Property::CreatePropertyFile(){
        if(PathIsDirectory(propertyPath) == FALSE){
 
                if(CreateDirectory(propertyPath,NULL) == 0){
-                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__));
+                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
        }
@@ -375,35 +404,96 @@ VOID Property::CreatePropertyFile(){
        if(PathIsDirectory(propertyPath) == FALSE){
 
                if(CreateDirectory(propertyPath,NULL) == 0){
-                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__));
+                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
                }
 
        }
 
-       propertyPath += TEXT("\\property.ini");
+       propertyPath += TEXT("\\property.xml");
 
                
        if(PathFileExists(propertyPath)== FALSE || PathIsDirectory(propertyPath) == TRUE){
-               HANDLE hPropertyini =   CreateFile(propertyPath,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+               HANDLE hPropertyxml =   CreateFile(propertyPath,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
 
-               if(hPropertyini == INVALID_HANDLE_VALUE ){
+               if(hPropertyxml == INVALID_HANDLE_VALUE ){
 
-                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__));
+                       throw Exception(TEXT("\90Ý\92è\83t\83@\83C\83\8b\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
 
                }
 
 
-               CloseHandle(hPropertyini);
+               CloseHandle(hPropertyxml);
        }
 
        return;
 }
 
 
-VOID Property::WriteIniFile(){
+VOID Property::WriteProperty(){
 
        CreatePropertyFile();
+       CComPtr<IXmlWriter> pWriter;
+    CreateXmlWriter(__uuidof(IXmlWriter), reinterpret_cast<void**>(&pWriter), 0);
+
+    // XML\83t\83@\83C\83\8b\83p\83X\8dì\90¬
+    TCHAR xml[MAX_PATH];
+       _tcscpy(xml,this->propertyPath);
+
+       
+       
+        // \83t\83@\83C\83\8b\83X\83g\83\8a\81[\83\80\8dì\90¬
+    CComPtr<IStream> pStream;
+    SHCreateStreamOnFile(xml, STGM_CREATE | STGM_WRITE, &pStream);
+
+       pWriter->SetOutput(pStream);
+       
+       // \83C\83\93\83f\83\93\83g\97L\8cø\89»
+    pWriter->SetProperty(XmlWriterProperty_Indent, TRUE);
+
+       // <?xml version="1.0" encoding="UTF-8"?>
+    pWriter->WriteStartDocument(XmlStandalone_Omit);
 
+       pWriter->WriteStartElement(NULL,TEXT("nliteconfig"),NULL);
+       //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\90Ý\92è\8f\91\82«\8d\9e\82Ý
+       NLITE_XMLELLMENT_WRITE(pWriter,crp);
+       NLITE_ATTRIBUTE_WRITE_STR(pWriter,crp.outString);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.administratorCommentReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.besideLengthFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.bspReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.commentReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.maxCommentLength);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.newLineReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.ngUserReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.ngWordReadFlag);
+       NLITE_ATTRIBUTE_WRITE_STR(pWriter,crp.shortComment);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.teropReadFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,crp.userCommentReadFlag);
+       pWriter->WriteEndElement();
+       //commentview\90Ý\92è\92l\8f\91\82«\8d\9e\82Ý
+       NLITE_XMLELLMENT_WRITE(pWriter,cvp);
+       NLITE_XML_WRITE_FOR_INT(pWriter,cvp.headerholSize);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.anonymousIDLinkColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.backColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.baseStringColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.commentFoldingFlag);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.commentTimeType);
+       NLITE_XML_WRITE_FOR_INT(pWriter,cvp.headerOraderArray);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.IDLinkColor);
+       pWriter->WriteEndElement();
+
+
+       pWriter->WriteEndDocument();
+       /*
+       {\
+               TCHAR buffer[LENGTH_256];\
+               for(UINT_PTR index = 0;index < ARRAY_LENGTH(cvp.headerholSize);index++){\
+                       _stprintf(buffer,TEXT("%s%d"),cvp.headerholSize,index);\
+                       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.headerholSize[index]);\
+               }\
+}
+*/
+
+       /*
        //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\90Ý\92è\8f\91\82«\8d\9e\82Ý
 
        NLITE_WRITE_INI_INT(crp,besideLengthFlag,propertyPath);
@@ -412,7 +502,7 @@ VOID Property::WriteIniFile(){
 
        NLITE_WRITE_INI_INT(crp,commentReadFlag,propertyPath);
 
-       NLITE_WRITE_INI_INT(crp,managementReadFlag,propertyPath);
+       NLITE_WRITE_INI_INT(crp,administratorCommentReadFlag,propertyPath);
 
        NLITE_WRITE_INI_INT(crp,maxCommentLength,propertyPath);
 
@@ -484,7 +574,7 @@ VOID Property::WriteIniFile(){
 
        NLITE_WRITE_INI_STR(gp,commentPath,propertyPath);
                        
-       NLITE_WRITE_INI_INT(gp,defaultBroserFlag,propertyPath);
+       NLITE_WRITE_INI_INT(gp,defaultBrowserFlag,propertyPath);
 
        NLITE_WRITE_INI_INT(gp,numberNameFlag,propertyPath);
 
@@ -530,7 +620,7 @@ VOID Property::WriteIniFile(){
        }
 
        WritePrivateProfileString(gp.GetSectionName(),TEXT(TOSTR(browserType)),browserTypeName,propertyPath);
-
+       */
        return;
 }
 
index 27e23b4..b265c58 100644 (file)
@@ -81,14 +81,13 @@ namespace nlite{
                };
 
        
-               
+       
 #define COMMENTVIEW_HEADERITEMSIZE 5
        public:
                INT_PTR headerholSize[COMMENTVIEW_HEADERITEMSIZE];                      //\83w\83b\83_\89¡\83T\83C\83Y
                INT_PTR headerOraderArray[COMMENTVIEW_HEADERITEMSIZE];          //\83w\83b\83_\95À\82Ñ\8f\87\94z\97ñ
                BOOL commentFoldingFlag;                                                                        //\83R\83\81\83\93\83g\90Ü\82è\82½\82½\82Ý\83t\83\89\83O
                UINT_PTR commentTimeType;                                                                       //\83R\83\81\83\93\83g\8e\9e\8aÔ\95\\8e¦\83^\83C\83v
-               
                COLORREF backColor;                                                                                     //\8aî\92ê\82Ì\94w\8ci\90F
                COLORREF baseStringColor;                                                                       //\8aî\92ê\82Ì\95\8e\9a\90F
                COLORREF IDLinkColor;                                                                           //\8aî\92ê\82Ì\83n\83C\83p\81[\83\8a\83\93\83N\82Ì\90F
@@ -111,7 +110,7 @@ namespace nlite{
                BOOL commentReadFlag;                                                           //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL ngWordReadFlag;                                                            //NG\83\8f\81[\83h\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL ngUserReadFlag;                                                            //NG\83\86\81[\83U\81[\93Ç\82Ý\8fã\82°\83t\83\89\83O
-               BOOL managementReadFlag;                                                        //\89^\89c\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83t\83\89\83O
+               BOOL administratorCommentReadFlag;                                      //\89^\89c\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL bspReadFlag;                                                                       //\83o\83b\83N\83X\83e\81[\83W\83p\83X\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL userCommentReadFlag;                                                       //\83\86\81[\83U\81[\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL teropReadFlag;                                                                     //\83e\83\8d\83b\83v\93Ç\82Ý\8fã\82°\83t\83\89\83O
@@ -137,14 +136,14 @@ namespace nlite{
                BOOL userCountUpdateFlag;                                       //\97\88\8fê\8eÒ\90\94\82ð\8dX\90V\82·\82é\82©\82Ì\83t\83\89\83O
                BOOL commentLogAutoSaveFlag;                            //\83R\83\81\83\93\83g\8e©\93®\95Û\91\97p\82Ì\83t\83\89\83O
                CNLiteString commentPath;                                       //\83R\83\81\83\93\83g\83\8d\83O\95Û\91\8fê\8f\8a
-               BOOL defaultBroserFlag;                                         //\83\8a\83\93\83N\82ð\8aJ\82­\8dÛ\82É\8aî\92ê\82Ì\83u\83\89\83E\83U\82ð\8eg\97p\82·\82é\82©\82Ì\83t\83\89\83O
+               BOOL defaultBrowserFlag;                                                //\83\8a\83\93\83N\82ð\8aJ\82­\8dÛ\82É\8aî\92ê\82Ì\83u\83\89\83E\83U\82ð\8eg\97p\82·\82é\82©\82Ì\83t\83\89\83O
                BOOL autoNameRegisterFlag;                                      //\83\86\81[\83U\96¼\8e©\93®\93o\98^\83t\83\89\83O
-               BOOL autoNameUpdateFlag;                                        //\8e©\93®\93o\98^\8e\9e\82É\8dX\90V\82·\82é\83t\83\89\83O
+               BOOL autoNameUpdateFlag;                                        //\8dX\90V\82µ\82Ä\8e©\93®\93o\98^\82·\82é\83t\83\89\83O
                BOOL numberNameFlag;                                            //\90\94\8e\9a\82Ì\82Ý\82Ì\96¼\91O\82ð\8b\96\89Â\82·\82é\82©\82Ì\83t\83\89\83O
                BOOL  autoColorRegisterFlag;                            //\96¼\91O\93o\98^\8e\9d\82É\90F\82ð\8e©\93®\93I\82É\8ew\92è\82·\82é\82©\82Ì\83t\83\89\83O
                BOOL activeCountTimeFlag;                                       //\83A\83N\83e\83B\83u\90l\90\94\82ð\8e©\93®\8dX\90V\82·\82é\82©\82Ì\83t\83\89\83O
                BROWSERTYPE browserType;                                        //\83u\83\89\83E\83U\83^\83C\83v
-
+               
 
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
@@ -200,10 +199,10 @@ namespace nlite{
        public:
                VOID Initialize();
 
-               VOID ReadIniFile();
+               VOID ReadProperty();
 
 
-               VOID WriteIniFile();
+               VOID WriteProperty();
 
                BROWSERTYPE CookieSetting();
 
index b1bfcdf..bdd6c24 100644 (file)
@@ -2,7 +2,7 @@
 #include "nlite_include.h"
 
 namespace nlite{
-
+/*
 ///
 ///\83R\83\93\83X\83g\83\89\83N\83^
 ///
@@ -13,5 +13,5 @@ CNLITESTRING_THISTYPE::CNLITESTRING_THISTYPE(LPCTSTR in_str):CNLITESTRING_INTERN
 CNLITESTRING_THISTYPE::CNLITESTRING_THISTYPE(const CNLITESTRING_INTERNALSTRINGTYPE_REFERENCE in_str):CNLITESTRING_INTERNALSTRINGTYPE(in_str){}
 
 CNLITESTRING_THISTYPE::CNLITESTRING_THISTYPE(const CNLITESTRING_THISTYPE_REFERENCE in_str):CNLITESTRING_INTERNALSTRINGTYPE(in_str){}
-
+*/
 }
\ No newline at end of file
index fe14401..df6e3df 100644 (file)
@@ -4,7 +4,7 @@ namespace nlite{
        
 //\96¼\91O\82â\83N\83\89\83X\82ð\95Ï\82¦\82½\82¢\8fê\8d\87\82Í\82±\82±\82ð\95Ï\82¦\82é
 #define CNLITESTRING_THISTYPE CNLiteString                             //\95\8e\9a\97ñ\83N\83\89\83X\96¼
-#define CNLITESTRING_INTERNALSTRINGTYPE CString                        //\93à\95\94\82Å\8f\88\97\9d\82ð\82·\82é\95\8e\9a\97ñ\83N\83\89\83X\96¼
+#define CNLITESTRING_INTERNALSTRINGTYPE CComBSTR                       //\93à\95\94\82Å\8f\88\97\9d\82ð\82·\82é\95\8e\9a\97ñ\83N\83\89\83X\96¼
 
 
 
@@ -12,8 +12,9 @@ namespace nlite{
 #define CNLITESTRING_THISTYPE_REFERENCE CNLITESTRING_THISTYPE&
 #define CNLITESTRING_INTERNALSTRINGTYPE_REFERENCE CNLITESTRING_INTERNALSTRINGTYPE& 
 
-
-
+typedef CNLITESTRING_INTERNALSTRINGTYPE CNLITESTRING_THISTYPE;
+typedef std::basic_string<TCHAR> tstring;
+/*
        ///
        ///nlite\95\8e\9a\97ñ\83N\83\89\83X
        ///CString\82ð\8cp\8f³
@@ -39,10 +40,14 @@ namespace nlite{
 
 public:
 
+       UINT_PTR GetLength(){
 
+               return this->Length();
+       }
 
        
                
 
        };
+*/
 }
\ No newline at end of file
index dbd1b74..fac8179 100644 (file)
@@ -64,7 +64,8 @@ extern CAppModule _Module;
 #include <atlctrlx.h>
 #include <atlsplit.h>
 #include <shellapi.h>
-
+#include <xmllite.h>
+#pragma comment(lib, "xmllite.lib")
 #pragma comment(lib,"ComCtl32.lib")
 #pragma comment(lib,"atlthunk.lib")
 #pragma comment(lib,"version.lib")