OSDN Git Service

2012/01/13 17:42:02
authorunknown <qwerty2501@users.sourceforge.jp>
Fri, 13 Jan 2012 08:42:02 +0000 (17:42 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Fri, 13 Jan 2012 08:42:02 +0000 (17:42 +0900)
14 files changed:
nlite.suo
nlite/nlite.cpp
nlite/nlite.vcxproj
nlite/nlite.vcxproj.filters
nlite/nlite_appinfo.h
nlite/nlite_chatData.h
nlite/nlite_define.h
nlite/nlite_exception.h
nlite/nlite_include.h
nlite/nlite_nlib.h
nlite/nlite_property.cpp
nlite/nlite_property.h
nlite/nlite_string.h [new file with mode: 0644]
nlite/stdafx.h

index 6d2ed66..907032e 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index a6c7c49..425c814 100644 (file)
@@ -55,7 +55,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
                goto nliteend;
                
        } catch(nlite::Exception &e){
-               tstring errMessage(TEXT("\83G\83\89\81[\83\81\83b\83Z\81[\83W:"));
+               CNLiteString errMessage(TEXT("\83G\83\89\81[\83\81\83b\83Z\81[\83W:"));
                errMessage += e.what();
                errMessage += TEXT("\r\n\8ds\94Ô\8d\86:");
                std::wostringstream num;
@@ -118,7 +118,7 @@ static BOOL InitializeNlite(){
                }
 
                const CApplicationInfo &appInfo = CApplicationInfo::getInstance();
-               tstring userAgent;
+               CNLiteString userAgent;
                userAgent.reserve(256);
                userAgent = appInfo.getProcuctName();
                userAgent += TEXT("/");
index 1fc8081..b4ae750 100644 (file)
     <ClInclude Include="nlite_appinfo.h" />
     <ClInclude Include="nlite_nlib.h" />
     <ClInclude Include="nlite_property.h" />
+    <ClInclude Include="nlite_string.h" />
     <ClInclude Include="Resource.h" />
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="targetver.h" />
index 57ddd65..9942bb1 100644 (file)
@@ -69,6 +69,9 @@
     <ClInclude Include="nlite_chatData.h">
       <Filter>ヘッダー ファイル</Filter>
     </ClInclude>
+    <ClInclude Include="nlite_string.h">
+      <Filter>ヘッダー ファイル</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="stdafx.cpp">
index ffa2ebf..ff3217d 100644 (file)
@@ -70,8 +70,8 @@ namespace nlite{
 
                VOID show() const {
 
-                       tstring szApp;
-                       tstring szOtherStuff;
+                       CNLiteString szApp;
+                       CNLiteString szOtherStuff;
 
 
                        szApp.reserve(LENGTH_128);
index 476b3e7..ca17fef 100644 (file)
@@ -14,8 +14,8 @@ namespace nlite{
        struct ListenerData{
 
        public:
-               tstring user_id;
-               tstring userName;
+               CNLiteString user_id;
+               CNLiteString userName;
                COLORREF bkColor;
                BOOL originBkFlag;
        public:
@@ -101,9 +101,9 @@ namespace nlite{
                time_t date;                                            //\8e\9e\8aÔ
                cuntry::LOCALE locale;                          //\8d\91\83R\81[\83h
                ListenerData *listenerData;                     //\83\86\81[\83U\8fî\95ñ
-               tstring name;                                           //\96¼\91O\81B\82Â\82¢\82Ä\82±\82È\82¢\8e\9e\82à\82 \82é
-               tstring chatBuf;                                        //\83`\83\83\83b\83g\96{\95
-               std::vector<tstring> mail;                      //\83\81\81[\83\8b\83R\83}\83\93\83h
+               CNLiteString name;                                              //\96¼\91O\81B\82Â\82¢\82Ä\82±\82È\82¢\8e\9e\82à\82 \82é
+               CNLiteString chatBuf;                                   //\83`\83\83\83b\83g\96{\95
+               std::vector<CNLiteString> mail;                 //\83\81\81[\83\8b\83R\83}\83\93\83h
                ULONG_PTR thread;                                       //\83X\83\8c\83b\83h\94Ô\8d\86
                BOOL selectFlag;                                        //\91I\91ð\8fó\91Ô
 
index acb52a6..212e561 100644 (file)
@@ -6,11 +6,6 @@
 
 namespace nlite{
 
-       //
-       //\8c^\92è\8b`
-       //
-
-       typedef std::basic_string<TCHAR> tstring;               //\95\8e\9a\97ñ
 
 
 
index 31586d4..b55fa1b 100644 (file)
@@ -9,7 +9,7 @@ namespace nlite{
        private:
                std::wstring  wErrMessage;
                UINT_PTR line;
-               tstring fileName;
+               CNLiteString fileName;
 
                //\83R\83\93\83X\83g\83\89\83N\83^
        public:
index 053b05d..0e78cda 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "nlite_define.h"
 #include "nlite.h"
+#include "nlite_string.h"
 #include "nlite_exception.h"
 #include "nlite_commentWrite.h"
 #include "nlite_nlib.h"
index 73d6046..a9de6af 100644 (file)
@@ -7,8 +7,8 @@ namespace nlite{
 
 
        public:
-               tstring id;
-               tstring default_community;
+               CNLiteString id;
+               CNLiteString default_community;
                PROVIDERTYPE provider_type;
                BOOL is_owner;
                time_t start_time;
index 5da39a0..3666e33 100644 (file)
@@ -135,7 +135,7 @@ VOID Property::ReadIniFile(){
 
 
 
-       typedef std::map<tstring, BROWSERTYPE> funcs_type;
+       typedef std::map<CNLiteString, BROWSERTYPE> funcs_type;
 
     funcs_type funcs;
     funcs.insert(std::make_pair(bt_none, BT_NOSETTING));
@@ -144,7 +144,7 @@ VOID Property::ReadIniFile(){
        funcs.insert(std::make_pair(bt_chrome, BT_GOOGLE_CHROME));
        funcs.insert(std::make_pair(bt_iecm,BT_IE_COMPONENT));
 
-    tstring browserTypeName;
+    CNLiteString browserTypeName;
 
        GetPrivateProfileString(gp.GetSectionName(),TEXT(TOSTR(browserType)),bt_none,&buffer[0],buffer.size(),propertyPath.c_str());
        browserTypeName = &buffer[0];
@@ -295,7 +295,7 @@ VOID Property::WriteIniFile(){
 
        NLITE_WRITE_INI_INT(gp,userCountUpdateFlag,propertyPath.c_str());
 
-       tstring browserTypeName;
+       CNLiteString browserTypeName;
 
 
        switch (gp.browserType){
index f10acbe..a37d84a 100644 (file)
@@ -123,7 +123,7 @@ skip:
                };
 
        private:
-               tstring sectionName;
+               CNLiteString sectionName;
                
 #define COMMENTVIEW_HEADERITEMSIZE 5
        public:
@@ -165,7 +165,7 @@ skip:
        struct CommentReadProperty{
 
        private:
-               tstring sectionName;
+               CNLiteString sectionName;
        public:
 
                BOOL commentReadFlag;                                                           //\83R\83\81\83\93\83g\93Ç\82Ý\8fã\82°\83t\83\89\83O
@@ -178,8 +178,8 @@ skip:
                BOOL newLineReadFlag;                                                           //\89ü\8ds\93Ç\82Ý\8fã\82°\83t\83\89\83O
                BOOL besideLengthFlag;                                                          //\93Ç\82Ý\8fã\82°\83T\83C\83Y\8c\88\92è\83t\83\89\83O
                UINT_PTR maxCommentLength;                                                      //\93Ç\82Ý\8fã\82°\83T\83C\83Y\90Ý\92è\8e\9e\82Ì\8dÅ\91å\83T\83C\83Y
-               tstring shortComment;                                                           //\8fÈ\97ª\8e\9e\82É\93Ç\82Ý\8fã\82°\82é\95\8e\9a\97ñ
-               tstring outString;                                                                      //\93Ç\82Ý\8fã\82°\8f\9c\8aO\95\8e\9a\97ñ
+               CNLiteString shortComment;                                                              //\8fÈ\97ª\8e\9e\82É\93Ç\82Ý\8fã\82°\82é\95\8e\9a\97ñ
+               CNLiteString outString;                                                                 //\93Ç\82Ý\8fã\82°\8f\9c\8aO\95\8e\9a\97ñ
                
 
                CommentReadProperty():
@@ -206,13 +206,13 @@ skip:
        ///
        struct GeneralProperty{
        private:
-               tstring sectionName;
+               CNLiteString sectionName;
 
        public:
-               tstring browserPath;                                            //\83u\83\89\83E\83U\82Ì\83p\83X
+               CNLiteString browserPath;                                               //\83u\83\89\83E\83U\82Ì\83p\83X
                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
-               tstring commentPath;                                            //\83R\83\81\83\93\83g\83\8d\83O\95Û\91\8fê\8f\8a
+               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 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
@@ -248,7 +248,7 @@ skip:
        struct MainFrameProperty{
 
        private:
-               tstring sectionName;
+               CNLiteString sectionName;
 
        public:
 
@@ -284,8 +284,8 @@ skip:
                MainFrameProperty mfp;
                GeneralProperty gp;
                CommentReadProperty crp;
-               tstring appLocalPath;
-               tstring propertyPath;
+               CNLiteString appLocalPath;
+               CNLiteString propertyPath;
 
 
                Property()
diff --git a/nlite/nlite_string.h b/nlite/nlite_string.h
new file mode 100644 (file)
index 0000000..7868d7d
--- /dev/null
@@ -0,0 +1,65 @@
+#pragma once
+
+namespace nlite{
+       ///
+       ///nlite\95\8e\9a\97ñ\83N\83\89\83X
+       ///\8aù\91\82Ì\95\8e\9a\97ñ\83N\83\89\83X\82Ì\83\89\83b\83p
+       ///
+
+       class CNLiteString{
+               //
+               //\8c^\92è\8b`
+               //
+       private:
+               typedef CString InternalString;
+               typedef CString::PCXSTR StrPtr;
+               typedef CString::PXSTR StrCPtr;
+               typedef CString::PCYSTR WStrPtr;
+               typedef CString::PYSTR WStrCPtr;
+               typedef CString::XCHAR Char_Type;
+               typedef CString::YCHAR WChar_Type;
+
+       public:
+               typedef WStrPtr NLiteStrPtr;
+               typedef WStrCPtr NLiteStrCPtr;
+               typedef TCHAR NLiteChar;
+               typedef CNLiteString ThisType;
+
+               //\83\81\83\93\83o
+       private:
+               InternalString is_string;
+
+
+
+       public:
+               ///
+               ///\83R\83\93\83X\83g\83\89\83N\83^
+               ///
+               CNLiteString():is_string(){}
+
+               CNLiteString(NLiteStrCPtr in_str):is_string(in_str){}
+
+               CNLiteString(InternalString &in_str):is_string(in_str){}
+
+               CNLiteString(CNLiteString &in_str):is_string(in_str){}
+
+
+
+
+
+               NLiteStrCPtr c_str(){
+
+                       return *this;
+               }
+
+               operator NLiteStrCPtr(){
+                       return (NLiteStrCPtr)(LPCWSTR)is_string;
+               }
+
+               ThisType &operator=(NLiteStrCPtr lpstr){
+                       is_string = lpstr;
+                       return (LPCWSTR)is_string;
+               }
+               
+       };
+}
\ No newline at end of file
index 206e928..f9f0238 100644 (file)
@@ -12,6 +12,7 @@
 #define  _CRT_NON_CONFORMING_SWPRINTFS 1       //vc++\82Ì\82¨\82¹\82Á\82©\82¢\82È\8cx\8d\90\82ð\8fÁ\82·\83}\83N\83\8d
 #define NOT_USE_MPOOL                                          //\83\81\83\82\83\8a\83v\81[\83\8b\8eg\97p\82µ\82È\82¢//
 #define USE_STUB
+#define _WTL_NO_CSTRING
 // Windows \83w\83b\83_\81\83t\83@\83C\83\8b:
 #include <windows.h>
 #include <WindowsX.h>
@@ -44,6 +45,7 @@
 
 // TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B
 #include <atlbase.h>
+#include <atlstr.h>
 #include <atlapp.h>
 extern CAppModule _Module;
 #include <atlwin.h>