dummy:
Common/NsmInfoUtility.cpp -> Common/NsmInfoUtility.h
cosmetics
@@ -1,4 +1,5 @@ | ||
1 | -#include <vector> | |
1 | +#include "OptionDlg.h" | |
2 | + | |
2 | 3 | #include <shlwapi.h> |
3 | 4 | #if defined(_MSC_VER) |
4 | 5 | #pragma comment(lib, "shlwapi.lib") |
@@ -8,7 +9,6 @@ | ||
8 | 9 | #include "../../Common/StrResource.h" |
9 | 10 | |
10 | 11 | #include "DlgOption.h" |
11 | -#include "OptionDlg.h" | |
12 | 12 | |
13 | 13 | #define RS_OK TEXT("Ok") |
14 | 14 | #define RS_CANCEL TEXT("Cancel") |
@@ -1,3 +1,5 @@ | ||
1 | +#include "StrRsc.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | #include <vector> |
3 | 5 | #include <windows.h> |
@@ -11,9 +13,7 @@ | ||
11 | 13 | #include "../../Common/StrResource.h" |
12 | 14 | |
13 | 15 | #include "OptionDlg.h" |
14 | -#include "StrRscConfig.h" | |
15 | 16 | #include "StrRscConsts.h" |
16 | -#include "StrRsc.h" | |
17 | 17 | |
18 | 18 | HINSTANCE g_hInstance; |
19 | 19 |
@@ -1,6 +1,7 @@ | ||
1 | 1 | #ifndef OPTIONDLG_H |
2 | 2 | #define OPTIONDLG_H |
3 | 3 | |
4 | +#include <vector> | |
4 | 5 | #include <windows.h> |
5 | 6 | |
6 | 7 | #include "../../Common/tstring.h" |
@@ -8,6 +8,8 @@ | ||
8 | 8 | #include "../../Common/NsmPluginMain.h" |
9 | 9 | #include "../../Common/StrRscTypes.h" |
10 | 10 | |
11 | +#include "StrRscConfig.h" | |
12 | + | |
11 | 13 | namespace Regnessem |
12 | 14 | { |
13 | 15 | namespace AddIn |
@@ -1,3 +1,5 @@ | ||
1 | +#include "StrRscConfig.h" | |
2 | + | |
1 | 3 | #include <windows.h> |
2 | 4 | #include <shlwapi.h> |
3 | 5 | #if defined(_MSC_VER) |
@@ -6,8 +8,6 @@ | ||
6 | 8 | |
7 | 9 | #include "../../Common/dummy.h" |
8 | 10 | |
9 | -#include "StrRscConfig.h" | |
10 | - | |
11 | 11 | namespace Regnessem |
12 | 12 | { |
13 | 13 | namespace AddIn |
@@ -1,3 +1,5 @@ | ||
1 | +#include "ProfMan.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | #include <sstream> |
3 | 5 | #include <deque> |
@@ -11,7 +13,6 @@ | ||
11 | 13 | #include "../../Common/dummy.h" |
12 | 14 | |
13 | 15 | #include "ProfManConsts.h" |
14 | -#include "ProfMan.h" | |
15 | 16 | |
16 | 17 | HINSTANCE g_hInstance; |
17 | 18 |
@@ -1,3 +1,5 @@ | ||
1 | +#include "OptionDlg.h" | |
2 | + | |
1 | 3 | #include <vector> |
2 | 4 | #include <sstream> |
3 | 5 |
@@ -6,7 +8,6 @@ | ||
6 | 8 | |
7 | 9 | #include "ClientSocketConsts.h" |
8 | 10 | #include "DlgOption.h" |
9 | -#include "OptionDlg.h" | |
10 | 11 | |
11 | 12 | extern HINSTANCE g_hInstance; |
12 | 13 |
@@ -62,7 +63,7 @@ | ||
62 | 63 | } |
63 | 64 | |
64 | 65 | SetDlgItemText(hDialog,IDC_EDPROXYHOST,ProxyHost.c_str()); |
65 | - SetDlgItemText(hDialog,IDC_EDPROXYPORT,ToString(ProxyPort).c_str()); | |
66 | + SetDlgItemText(hDialog,IDC_EDPROXYPORT,ToString(static_cast<unsigned>(ProxyPort)).c_str()); | |
66 | 67 | |
67 | 68 | SendDlgItemMessage(hDialog,IDC_CBPROXYTYPE,CB_INSERTSTRING,static_cast<WPARAM>(-1),reinterpret_cast<LPARAM>(TEXT("HTTP"))); |
68 | 69 | SendDlgItemMessage(hDialog,IDC_CBPROXYTYPE,CB_INSERTSTRING,static_cast<WPARAM>(-1),reinterpret_cast<LPARAM>(TEXT("SOCKS4"))); |
@@ -3,6 +3,8 @@ | ||
3 | 3 | |
4 | 4 | #include <windows.h> |
5 | 5 | |
6 | +#include "../../Common/tstring.h" | |
7 | + | |
6 | 8 | namespace Regnessem |
7 | 9 | { |
8 | 10 | namespace AddIn |
@@ -2,15 +2,16 @@ | ||
2 | 2 | #pragma comment(lib, "ws2_32.lib") |
3 | 3 | #endif |
4 | 4 | |
5 | +#include <winsock2.h> | |
6 | +#include "NsmClientSocket.h" | |
7 | + | |
5 | 8 | #include <sstream> |
6 | 9 | |
7 | -#include <winsock2.h> | |
8 | 10 | #include <ws2tcpip.h> |
9 | 11 | |
10 | 12 | #include "../../Common/dummy.h" |
11 | 13 | |
12 | 14 | #include "ClientSocketConsts.h" |
13 | -#include "NsmClientSocket.h" | |
14 | 15 | |
15 | 16 | extern HINSTANCE g_hInstance; |
16 | 17 |
@@ -1,3 +1,5 @@ | ||
1 | +#include "ClientSocket.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | |
3 | 5 | #include "../../Common/dummy.h" |
@@ -6,7 +8,6 @@ | ||
6 | 8 | |
7 | 9 | #include "ClientSocketConsts.h" |
8 | 10 | #include "OptionDlg.h" |
9 | -#include "ClientSocket.h" | |
10 | 11 | |
11 | 12 | #ifdef NDEBUG |
12 | 13 | #define RgnOutputDebugString(str) |
@@ -3,6 +3,7 @@ | ||
3 | 3 | |
4 | 4 | #include <vector> |
5 | 5 | |
6 | +#include "../../Common/tstring.h" | |
6 | 7 | #include "../../Common/LockList.h" |
7 | 8 | #include "../../Common/ClientSocketTypes.h" |
8 | 9 |
@@ -1,3 +1,5 @@ | ||
1 | +#include "ClientSocketConfig.h" | |
2 | + | |
1 | 3 | #include <vector> |
2 | 4 | #include <sstream> |
3 | 5 |
@@ -7,7 +9,6 @@ | ||
7 | 9 | #include "../../Common/dummy.h" |
8 | 10 | |
9 | 11 | #include "ClientSocketConsts.h" |
10 | -#include "ClientSocketConfig.h" | |
11 | 12 | |
12 | 13 | namespace Regnessem |
13 | 14 | { |
@@ -1,3 +1,5 @@ | ||
1 | +#include "OptionDlg.h" | |
2 | + | |
1 | 3 | #include <vector> |
2 | 4 | |
3 | 5 | #include <shlobj.h> |
@@ -6,7 +8,6 @@ | ||
6 | 8 | |
7 | 9 | #include "FileIOConfig.h" |
8 | 10 | #include "DlgOption.h" |
9 | -#include "OptionDlg.h" | |
10 | 11 | |
11 | 12 | extern HINSTANCE g_hInstance; |
12 | 13 |
@@ -3,6 +3,8 @@ | ||
3 | 3 | |
4 | 4 | #include <windows.h> |
5 | 5 | |
6 | +#include "../../Common/tstring.h" | |
7 | + | |
6 | 8 | namespace Regnessem |
7 | 9 | { |
8 | 10 | namespace AddIn |
@@ -1,3 +1,5 @@ | ||
1 | +#include "FileIO.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | |
3 | 5 | #include <shobjidl.h> |
@@ -11,9 +13,7 @@ | ||
11 | 13 | #include "../../Common/NsmInfoUtility.h" |
12 | 14 | |
13 | 15 | #include "OptionDlg.h" |
14 | -#include "FileIOConfig.h" | |
15 | 16 | #include "FileIOConsts.h" |
16 | -#include "FileIO.h" | |
17 | 17 | |
18 | 18 | HINSTANCE g_hInstance; |
19 | 19 |
@@ -9,6 +9,7 @@ | ||
9 | 9 | #include "../../Common/LockList.h" |
10 | 10 | |
11 | 11 | #include "FileIOTypes.h" |
12 | +#include "FileIOConfig.h" | |
12 | 13 | |
13 | 14 | namespace Regnessem |
14 | 15 | { |
@@ -1,193 +0,0 @@ | ||
1 | -#include <algorithm> | |
2 | - | |
3 | -#include "dummy.h" | |
4 | -#include "UNsmConsts.h" | |
5 | -#include "NsmInfoUtility.h" | |
6 | - | |
7 | -namespace Regnessem | |
8 | -{ | |
9 | - namespace Common | |
10 | - { | |
11 | - namespace NsmInfoUtility | |
12 | - { | |
13 | - template <int Type> struct NsmInfoValueType; | |
14 | - template <> struct NsmInfoValueType<NMIT_STRING> { typedef char Type; }; | |
15 | - template <> struct NsmInfoValueType<NMIT_WIDESTRING> { typedef wchar_t Type; }; | |
16 | - template <> struct NsmInfoValueType<NMIT_INTEGER> { typedef INT32 Type; }; | |
17 | - template <> struct NsmInfoValueType<NMIT_BOOL> { typedef unsigned char Type; }; | |
18 | - template <> struct NsmInfoValueType<NMIT_INT64> { typedef INT64 Type; }; | |
19 | - | |
20 | - template <int InfoType> | |
21 | - inline int IntegerToNsmInfo(TNsmInfo *nsmInfo, typename NsmInfoValueType<InfoType>::Type value) | |
22 | - { | |
23 | - typedef typename NsmInfoValueType<InfoType>::Type T; | |
24 | - | |
25 | - if(!nsmInfo) | |
26 | - return 0; | |
27 | - | |
28 | - if(!nsmInfo->lpBuffer) | |
29 | - return 0; | |
30 | - | |
31 | - if(nsmInfo->nBufferSize < sizeof(T)) | |
32 | - return 0; | |
33 | - | |
34 | - nsmInfo->nType = InfoType; | |
35 | - *static_cast<T*>(nsmInfo->lpBuffer) = value; | |
36 | - | |
37 | - return sizeof(T); | |
38 | - } | |
39 | - | |
40 | - template <int InfoType> | |
41 | - inline int StringToNsmInfo(TNsmInfo *nsmInfo, const std::basic_string<typename NsmInfoValueType<InfoType>::Type> &str) | |
42 | - { | |
43 | - typedef typename NsmInfoValueType<InfoType>::Type T; | |
44 | - | |
45 | - if(!nsmInfo) | |
46 | - return 0; | |
47 | - | |
48 | - if(!nsmInfo->lpBuffer) | |
49 | - return 0; | |
50 | - | |
51 | - if(nsmInfo->nBufferSize < sizeof(T)) | |
52 | - return 0; | |
53 | - | |
54 | - nsmInfo->nType = InfoType; | |
55 | - typename std::basic_string<T>::size_type len | |
56 | - = std::min<typename std::basic_string<T>::size_type>(nsmInfo->nBufferSize / sizeof(T) - 1, str.size()); | |
57 | - | |
58 | -#ifdef _MSC_VER | |
59 | - str._Copy_s(static_cast<T*>(nsmInfo->lpBuffer), nsmInfo->nBufferSize / sizeof(T), len); | |
60 | -#else | |
61 | - str.copy(static_cast<T*>(nsmInfo->lpBuffer), len); | |
62 | -#endif | |
63 | - | |
64 | - static_cast<T*>(nsmInfo->lpBuffer)[len] = T(); | |
65 | - return static_cast<int>((len + 1) * sizeof(T)); | |
66 | - } | |
67 | - | |
68 | - template <int InfoType> | |
69 | - inline typename NsmInfoValueType<InfoType>::Type NsmInfoToInteger(const TNsmInfo *nsmInfo) | |
70 | - { | |
71 | - typedef typename NsmInfoValueType<InfoType>::Type T; | |
72 | - | |
73 | - if(!nsmInfo) | |
74 | - return 0; | |
75 | - | |
76 | - if(!nsmInfo->lpBuffer) | |
77 | - return 0; | |
78 | - | |
79 | - if(nsmInfo->nBufferSize < sizeof(T)) | |
80 | - return 0; | |
81 | - | |
82 | - if(nsmInfo->nType == InfoType) | |
83 | - return *static_cast<T*>(nsmInfo->lpBuffer); | |
84 | - | |
85 | - return 0; | |
86 | - } | |
87 | - | |
88 | - //---- | |
89 | - | |
90 | - int StrToNsmInfo(const PNsmInfo nsmInfo, const std::string &value) | |
91 | - { | |
92 | - return StringToNsmInfo<NMIT_STRING>(nsmInfo, value); | |
93 | - } | |
94 | - | |
95 | - int StrToNsmInfo(const PNsmInfo nsmInfo, const std::wstring &value) | |
96 | - { | |
97 | - return StringToNsmInfo<NMIT_WIDESTRING>(nsmInfo, value); | |
98 | - } | |
99 | - | |
100 | - int IntToNsmInfo(const PNsmInfo nsmInfo, const INT32 value) | |
101 | - { | |
102 | - return IntegerToNsmInfo<NMIT_INTEGER>(nsmInfo, value); | |
103 | - } | |
104 | - | |
105 | - int Int64ToNsmInfo(const PNsmInfo nsmInfo, const INT64 value) | |
106 | - { | |
107 | - return IntegerToNsmInfo<NMIT_INT64>(nsmInfo, value); | |
108 | - } | |
109 | - | |
110 | - int BoolToNsmInfo(const PNsmInfo nsmInfo, const bool value) | |
111 | - { | |
112 | - return IntegerToNsmInfo<NMIT_BOOL>(nsmInfo, value ? 1 : 0); | |
113 | - } | |
114 | - | |
115 | - //----------------------------------------------------------------------------------------------- | |
116 | - | |
117 | - const std::size_t NsmInfoStrMaxLength = 1024 * 100; | |
118 | - | |
119 | - std::string NsmInfoToStrA(const TNsmInfo *const nsmInfo) | |
120 | - { | |
121 | - if(!nsmInfo) | |
122 | - return std::string(); | |
123 | - | |
124 | - if(!nsmInfo->lpBuffer) | |
125 | - return std::string(); | |
126 | - | |
127 | - switch(nsmInfo->nType) | |
128 | - { | |
129 | - case NMIT_STRING: | |
130 | - if(sizeof(char) <= nsmInfo->nBufferSize) | |
131 | - { | |
132 | - const char *const begin = static_cast<char*>(nsmInfo->lpBuffer); | |
133 | - return std::string(begin, std::find(begin, begin + NsmInfoStrMaxLength, char())); | |
134 | - } | |
135 | - break; | |
136 | - case NMIT_WIDESTRING: | |
137 | - if(sizeof(wchar_t) <= nsmInfo->nBufferSize) | |
138 | - { | |
139 | - const wchar_t *const begin = static_cast<wchar_t*>(nsmInfo->lpBuffer); | |
140 | - return w2c(std::wstring(begin, std::find(begin, begin + NsmInfoStrMaxLength, wchar_t()))); | |
141 | - } | |
142 | - break; | |
143 | - } | |
144 | - | |
145 | - return std::string(); | |
146 | - } | |
147 | - | |
148 | - std::wstring NsmInfoToStrW(const TNsmInfo *const nsmInfo) | |
149 | - { | |
150 | - if(!nsmInfo) | |
151 | - return std::wstring(); | |
152 | - | |
153 | - if(!nsmInfo->lpBuffer) | |
154 | - return std::wstring(); | |
155 | - | |
156 | - switch(nsmInfo->nType) | |
157 | - { | |
158 | - case NMIT_STRING: | |
159 | - if(sizeof(char) <= nsmInfo->nBufferSize) | |
160 | - { | |
161 | - const char *const begin = static_cast<char*>(nsmInfo->lpBuffer); | |
162 | - return c2w(std::string(begin, std::find(begin, begin + NsmInfoStrMaxLength, char()))); | |
163 | - } | |
164 | - break; | |
165 | - case NMIT_WIDESTRING: | |
166 | - if(sizeof(wchar_t) <= nsmInfo->nBufferSize) | |
167 | - { | |
168 | - const wchar_t *const begin = static_cast<wchar_t*>(nsmInfo->lpBuffer); | |
169 | - return std::wstring(begin, std::find(begin, begin + NsmInfoStrMaxLength, wchar_t())); | |
170 | - } | |
171 | - break; | |
172 | - } | |
173 | - | |
174 | - return std::wstring(); | |
175 | - } | |
176 | - | |
177 | - INT32 NsmInfoToInt(const TNsmInfo *const nsmInfo) | |
178 | - { | |
179 | - return NsmInfoToInteger<NMIT_INTEGER>(nsmInfo); | |
180 | - } | |
181 | - | |
182 | - INT64 NsmInfoToInt64(const TNsmInfo *const nsmInfo) | |
183 | - { | |
184 | - return NsmInfoToInteger<NMIT_INT64>(nsmInfo); | |
185 | - } | |
186 | - | |
187 | - bool NsmInfoToBool(const TNsmInfo *const nsmInfo) | |
188 | - { | |
189 | - return NsmInfoToInteger<NMIT_BOOL>(nsmInfo) != 0; | |
190 | - } | |
191 | - } | |
192 | - } | |
193 | -} |
@@ -7,31 +7,42 @@ | ||
7 | 7 | |
8 | 8 | #include "tstring.h" |
9 | 9 | |
10 | -std::tstring PtrToHex(const void *const value); | |
10 | +std::tstring PtrToHex(const void* value); | |
11 | 11 | |
12 | +namespace dummy_private | |
13 | +{ | |
14 | + template <typename T> struct to_string_type {}; | |
15 | + template <> struct to_string_type<int> { typedef long long cast_type; }; | |
16 | + template <> struct to_string_type<long> { typedef long long cast_type; }; | |
17 | + template <> struct to_string_type<long long> { typedef long long cast_type; }; | |
18 | + template <> struct to_string_type<unsigned> { typedef unsigned long long cast_type; }; | |
19 | + template <> struct to_string_type<unsigned long> { typedef unsigned long long cast_type; }; | |
20 | + template <> struct to_string_type<unsigned long long> { typedef unsigned long long cast_type; }; | |
21 | +} | |
22 | + | |
12 | 23 | template <typename T> |
13 | -std::string ToStringA(T value) | |
24 | +std::string ToStringA(T val) | |
14 | 25 | { |
15 | - std::stringstream strm; | |
16 | - strm << value; | |
17 | - return strm.str(); | |
26 | + return std::to_string(static_cast<typename dummy_private::to_string_type<T>::cast_type>(val)); | |
18 | 27 | } |
19 | 28 | |
20 | 29 | template <typename T> |
21 | -std::wstring ToStringW(T value) | |
30 | +std::wstring ToStringW(T val) | |
22 | 31 | { |
23 | - std::wstringstream strm; | |
24 | - strm << value; | |
25 | - return strm.str(); | |
32 | + return std::to_wstring(static_cast<typename dummy_private::to_string_type<T>::cast_type>(val)); | |
26 | 33 | } |
27 | 34 | |
35 | +template <typename T> | |
36 | +Regnessem::tstring ToString(T val) | |
37 | +{ | |
28 | 38 | #ifdef UNICODE |
29 | -#define ToString ToStringW | |
39 | + return ToStringW(val); | |
30 | 40 | #else |
31 | -#define ToString ToStringA | |
41 | + return ToStringA(val); | |
32 | 42 | #endif |
43 | +} | |
33 | 44 | |
34 | -std::tstring TimeToStr(time_t); | |
45 | +std::tstring TimeToStr(std::time_t t); | |
35 | 46 | |
36 | 47 | std::tstring ExtractFileName(const std::tstring &fileName); |
37 | 48 | std::tstring ExtractFilePath(const std::tstring &fileName); |
@@ -38,24 +49,34 @@ | ||
38 | 49 | |
39 | 50 | bool ForceDirectories(const std::tstring &dirPath); |
40 | 51 | |
41 | -const std:: string w2c(const std::wstring &src); | |
42 | -const std::wstring c2w(const std:: string &src); | |
52 | +std:: string w2c(const std::wstring &src); | |
53 | +std::wstring c2w(const std:: string &src); | |
43 | 54 | |
44 | -inline const std::wstring& w2w(const std::wstring &src){return src;} | |
45 | -inline const std:: string& c2c(const std:: string &src){return src;} | |
55 | +namespace dummy_private | |
56 | +{ | |
57 | + inline std:: string t2x(const std::wstring &str){return w2c(str);} | |
58 | + inline std::wstring t2x(const std:: string &str){return c2w(str);} | |
59 | +} | |
46 | 60 | |
47 | -#ifdef UNICODE | |
48 | -#define w2t w2w | |
49 | -#define c2t c2w | |
50 | -#define t2c w2c | |
51 | -#define t2w w2w | |
52 | -#else | |
53 | -#define w2t w2c | |
54 | -#define c2t c2c | |
55 | -#define t2c c2c | |
56 | -#define t2w c2w | |
57 | -#endif | |
61 | +template <typename T, typename U> | |
62 | +std::basic_string<T> ConvertString(const std::basic_string<U> &str, | |
63 | + typename std::enable_if<std::is_same<T, U>::value>::type* = 0) | |
64 | +{ | |
65 | + return str; | |
66 | +} | |
58 | 67 | |
68 | +template <typename T, typename U> | |
69 | +std::basic_string<T> ConvertString(const std::basic_string<U> &str, | |
70 | + typename std::enable_if<!std::is_same<T, U>::value>::type* = 0) | |
71 | +{ | |
72 | + return dummy_private::t2x(str); | |
73 | +} | |
74 | + | |
75 | +inline Regnessem::tstring w2t(const std::wstring &src){return ConvertString<Regnessem::tstring::value_type>(src);} | |
76 | +inline Regnessem::tstring c2t(const std:: string &src){return ConvertString<Regnessem::tstring::value_type>(src);} | |
77 | +inline std:: string t2c(const Regnessem::tstring &src){return ConvertString<char>(src);} | |
78 | +inline std::wstring t2w(const Regnessem::tstring &src){return ConvertString<wchar_t>(src);} | |
79 | + | |
59 | 80 | #if defined(WINCE) |
60 | 81 | // compatibility |
61 | 82 | #define GWLP_WNDPROC (-4) |
@@ -1,6 +1,11 @@ | ||
1 | 1 | #ifndef NSMINFOUTILITY_H |
2 | 2 | #define NSMINFOUTILITY_H |
3 | 3 | |
4 | +#include <cstdint> | |
5 | +#include <algorithm> | |
6 | + | |
7 | +#include "dummy.h" | |
8 | +#include "UNsmConsts.h" | |
4 | 9 | #include "NsmTypes.h" |
5 | 10 | #include "tstring.h" |
6 | 11 |
@@ -10,26 +15,170 @@ | ||
10 | 15 | { |
11 | 16 | namespace NsmInfoUtility |
12 | 17 | { |
13 | - int StrToNsmInfo(const PNsmInfo nsmInfo, const std::string &value); // std::string -> TNsmInfo | |
14 | - int StrToNsmInfo(const PNsmInfo nsmInfo, const std::wstring &value); // std::wstring -> TNsmInfo | |
15 | - int IntToNsmInfo(const PNsmInfo nsmInfo, const INT32 value); // INT32 -> TNsmInfo | |
16 | - int Int64ToNsmInfo(const PNsmInfo nsmInfo, const INT64 value); // INT64 -> TNsmInfo | |
17 | - int BoolToNsmInfo(const PNsmInfo nsmInfo, const bool value); // bool -> TNsmInfo | |
18 | + template <int Type> struct NsmInfoValueType; | |
19 | + template <> struct NsmInfoValueType<NMIT_STRING> { typedef char Type; }; | |
20 | + template <> struct NsmInfoValueType<NMIT_WIDESTRING> { typedef wchar_t Type; }; | |
21 | + template <> struct NsmInfoValueType<NMIT_INTEGER> { typedef std::int32_t Type; }; | |
22 | + template <> struct NsmInfoValueType<NMIT_BOOL> { typedef unsigned char Type; }; | |
23 | + template <> struct NsmInfoValueType<NMIT_INT64> { typedef std::int64_t Type; }; | |
18 | 24 | |
19 | - std::string NsmInfoToStrA(const TNsmInfo *const nsmInfo); // TNsmInfo -> std::string | |
20 | - std::wstring NsmInfoToStrW(const TNsmInfo *const nsmInfo); // TNsmInfo -> std::wstring | |
21 | - INT32 NsmInfoToInt(const TNsmInfo *const nsmInfo); // TNsmInfo -> INT32 | |
22 | - INT64 NsmInfoToInt64(const TNsmInfo *const nsmInfo); // TNsmInfo -> INT64 | |
23 | - bool NsmInfoToBool(const TNsmInfo *const nsmInfo); // TNsmInfo -> bool | |
25 | + inline bool CheckPtr(const TNsmInfo *nsmInfo) | |
26 | + { | |
27 | + if(!nsmInfo) | |
28 | + return false; | |
24 | 29 | |
25 | - inline std::tstring NsmInfoToStr(const TNsmInfo *const nsmInfo) | |
30 | + if(!nsmInfo->lpBuffer) | |
31 | + return false; | |
32 | + | |
33 | + return true; | |
34 | + } | |
35 | + | |
36 | + template <typename T> | |
37 | + bool CheckBuff(const TNsmInfo *nsmInfo) | |
26 | 38 | { |
27 | -#ifdef UNICODE | |
28 | - return NsmInfoToStrW(nsmInfo); | |
39 | + if(!CheckPtr(nsmInfo)) | |
40 | + return false; | |
41 | + | |
42 | + if(nsmInfo->nBufferSize < sizeof(T)) | |
43 | + return false; | |
44 | + | |
45 | + return true; | |
46 | + } | |
47 | + | |
48 | + template <int InfoType> | |
49 | + int IntegerToNsmInfo(TNsmInfo *nsmInfo, typename NsmInfoValueType<InfoType>::Type value) | |
50 | + { | |
51 | + typedef typename NsmInfoValueType<InfoType>::Type T; | |
52 | + | |
53 | + if(!CheckBuff<T>(nsmInfo)) | |
54 | + return 0; | |
55 | + | |
56 | + nsmInfo->nType = InfoType; | |
57 | + *static_cast<T*>(nsmInfo->lpBuffer) = value; | |
58 | + | |
59 | + return sizeof(T); | |
60 | + } | |
61 | + | |
62 | + template <int InfoType> | |
63 | + int StringToNsmInfo(TNsmInfo *nsmInfo, const std::basic_string<typename NsmInfoValueType<InfoType>::Type> &str) | |
64 | + { | |
65 | + typedef typename NsmInfoValueType<InfoType>::Type T; | |
66 | + | |
67 | + if(!CheckBuff<T>(nsmInfo)) | |
68 | + return 0; | |
69 | + | |
70 | + nsmInfo->nType = InfoType; | |
71 | + auto len = std::min<typename std::basic_string<T>::size_type>(nsmInfo->nBufferSize / sizeof(T) - 1, str.size()); | |
72 | + | |
73 | +#ifdef _MSC_VER | |
74 | + str._Copy_s(static_cast<T*>(nsmInfo->lpBuffer), nsmInfo->nBufferSize / sizeof(T), len); | |
29 | 75 | #else |
30 | - return NsmInfoToStrA(nsmInfo); | |
76 | + str.copy(static_cast<T*>(nsmInfo->lpBuffer), len); | |
31 | 77 | #endif |
78 | + | |
79 | + static_cast<T*>(nsmInfo->lpBuffer)[len] = T(); | |
80 | + return static_cast<int>((len + 1) * sizeof(T)); | |
32 | 81 | } |
82 | + | |
83 | + template <int InfoType> | |
84 | + typename NsmInfoValueType<InfoType>::Type NsmInfoToInteger(const TNsmInfo *nsmInfo) | |
85 | + { | |
86 | + typedef typename NsmInfoValueType<InfoType>::Type T; | |
87 | + | |
88 | + if(!CheckBuff<T>(nsmInfo)) | |
89 | + return T(); | |
90 | + | |
91 | + if(nsmInfo->nType != InfoType) | |
92 | + return T(); | |
93 | + | |
94 | + return *static_cast<T*>(nsmInfo->lpBuffer); | |
95 | + } | |
96 | + | |
97 | + template <typename T> | |
98 | + std::basic_string<T> NsmInfoToString(const TNsmInfo *nsmInfo) | |
99 | + { | |
100 | + static const std::size_t NsmInfoStrMaxLength = 1024 * 100; | |
101 | + | |
102 | + if(!CheckPtr(nsmInfo)) | |
103 | + return std::basic_string<T>(); | |
104 | + | |
105 | + switch(nsmInfo->nType) | |
106 | + { | |
107 | + case NMIT_STRING: | |
108 | + if(sizeof(char) <= nsmInfo->nBufferSize) | |
109 | + { | |
110 | + const char *const begin = static_cast<char*>(nsmInfo->lpBuffer); | |
111 | + return ConvertString<T>(std::string(begin, std::find(begin, begin + NsmInfoStrMaxLength, char()))); | |
112 | + } | |
113 | + break; | |
114 | + case NMIT_WIDESTRING: | |
115 | + if(sizeof(wchar_t) <= nsmInfo->nBufferSize) | |
116 | + { | |
117 | + const wchar_t *const begin = static_cast<wchar_t*>(nsmInfo->lpBuffer); | |
118 | + return ConvertString<T>(std::wstring(begin, std::find(begin, begin + NsmInfoStrMaxLength, wchar_t()))); | |
119 | + } | |
120 | + break; | |
121 | + } | |
122 | + | |
123 | + return std::basic_string<T>(); | |
124 | + } | |
125 | + | |
126 | + //----------------------------------------------------------------------------------------------- | |
127 | + | |
128 | + inline int StrToNsmInfo(TNsmInfo *nsmInfo, const std::string &value) | |
129 | + { | |
130 | + return StringToNsmInfo<NMIT_STRING>(nsmInfo, value); | |
131 | + } | |
132 | + | |
133 | + inline int StrToNsmInfo(TNsmInfo *nsmInfo, const std::wstring &value) | |
134 | + { | |
135 | + return StringToNsmInfo<NMIT_WIDESTRING>(nsmInfo, value); | |
136 | + } | |
137 | + | |
138 | + inline int IntToNsmInfo(TNsmInfo *nsmInfo, std::int32_t value) | |
139 | + { | |
140 | + return IntegerToNsmInfo<NMIT_INTEGER>(nsmInfo, value); | |
141 | + } | |
142 | + | |
143 | + inline int Int64ToNsmInfo(TNsmInfo *nsmInfo, std::int64_t value) | |
144 | + { | |
145 | + return IntegerToNsmInfo<NMIT_INT64>(nsmInfo, value); | |
146 | + } | |
147 | + | |
148 | + inline int BoolToNsmInfo(TNsmInfo *nsmInfo, bool value) | |
149 | + { | |
150 | + return IntegerToNsmInfo<NMIT_BOOL>(nsmInfo, value ? 1 : 0); | |
151 | + } | |
152 | + | |
153 | + inline std::string NsmInfoToStrA(const TNsmInfo *nsmInfo) | |
154 | + { | |
155 | + return NsmInfoToString<char>(nsmInfo); | |
156 | + } | |
157 | + | |
158 | + inline std::wstring NsmInfoToStrW(const TNsmInfo *nsmInfo) | |
159 | + { | |
160 | + return NsmInfoToString<wchar_t>(nsmInfo); | |
161 | + } | |
162 | + | |
163 | + inline std::tstring NsmInfoToStr(const TNsmInfo *nsmInfo) | |
164 | + { | |
165 | + return NsmInfoToString<tstring::value_type>(nsmInfo); | |
166 | + } | |
167 | + | |
168 | + inline std::int32_t NsmInfoToInt(const TNsmInfo *nsmInfo) | |
169 | + { | |
170 | + return NsmInfoToInteger<NMIT_INTEGER>(nsmInfo); | |
171 | + } | |
172 | + | |
173 | + inline std::int64_t NsmInfoToInt64(const TNsmInfo *nsmInfo) | |
174 | + { | |
175 | + return NsmInfoToInteger<NMIT_INT64>(nsmInfo); | |
176 | + } | |
177 | + | |
178 | + inline bool NsmInfoToBool(const TNsmInfo *nsmInfo) | |
179 | + { | |
180 | + return NsmInfoToInteger<NMIT_BOOL>(nsmInfo) != 0; | |
181 | + } | |
33 | 182 | } |
34 | 183 | } |
35 | 184 | } |
@@ -1,3 +1,5 @@ | ||
1 | +#include "StrResource.h" | |
2 | + | |
1 | 3 | #include <cstring> |
2 | 4 | #include <vector> |
3 | 5 |
@@ -9,7 +11,6 @@ | ||
9 | 11 | #include "dummy.h" |
10 | 12 | #include "StrRscCommonConsts.h" |
11 | 13 | #include "StrRscTypes.h" |
12 | -#include "StrResource.h" | |
13 | 14 | |
14 | 15 | extern HINSTANCE g_hInstance; |
15 | 16 |
@@ -19,12 +20,12 @@ | ||
19 | 20 | { |
20 | 21 | namespace StrRsc |
21 | 22 | { |
22 | - std::auto_ptr<StrResource> g_StrResource; | |
23 | + std::unique_ptr<StrResource> g_StrResource; | |
23 | 24 | |
24 | 25 | StrResource::StrResource(const TNsmPluginInitInfo& initInfo) |
25 | - :PluginName(t2c(GetPluginName())), | |
26 | - InitInfo(initInfo), | |
27 | - SvcChecked(false) | |
26 | + :PluginName(t2c(GetPluginName())) | |
27 | + ,InitInfo(initInfo) | |
28 | + ,SvcChecked() | |
28 | 29 | {} |
29 | 30 | |
30 | 31 | std::tstring StrResource::DecodeCrLf(const std::tstring &source) |
@@ -1,3 +1,5 @@ | ||
1 | +#include "NsmPluginMain.h" | |
2 | + | |
1 | 3 | #include <vector> |
2 | 4 | |
3 | 5 | #include <shlwapi.h> |
@@ -6,7 +8,6 @@ | ||
6 | 8 | #endif |
7 | 9 | |
8 | 10 | #include "dummy.h" |
9 | -#include "NsmPluginMain.h" | |
10 | 11 | |
11 | 12 | extern HINSTANCE g_hInstance; |
12 | 13 |
@@ -35,7 +35,7 @@ | ||
35 | 35 | std::tstring GetLocalStr(const std::tstring §ion, const std::tstring &key, const std::tstring &defStr); |
36 | 36 | }; |
37 | 37 | |
38 | - extern std::auto_ptr<StrResource> g_StrResource; | |
38 | + extern std::unique_ptr<StrResource> g_StrResource; | |
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
@@ -1,15 +1,12 @@ | ||
1 | -//#include <locale> | |
2 | -#include <stdexcept> | |
3 | -#include <vector> | |
4 | -#include <iomanip> | |
1 | +#include "dummy.h" | |
5 | 2 | |
6 | 3 | #include <cassert> |
7 | 4 | #include <cstdarg> |
8 | 5 | #include <cstdio> |
6 | +#include <stdexcept> | |
7 | +#include <vector> | |
8 | +#include <iomanip> | |
9 | 9 | |
10 | -#include "NsmTypes.h" | |
11 | -#include "dummy.h" | |
12 | - | |
13 | 10 | #if defined(_WINDOWS) |
14 | 11 | #include <windows.h> |
15 | 12 | #include <shlwapi.h> |
@@ -24,6 +21,9 @@ | ||
24 | 21 | |
25 | 22 | static iconv_t ic_c2w = 0, ic_w2c = 0; |
26 | 23 | #endif |
24 | + | |
25 | +#include "NsmTypes.h" | |
26 | + | |
27 | 27 | #ifdef WINCE |
28 | 28 | struct tm *__cdecl localtime(const time_t *t) |
29 | 29 | { |
@@ -49,7 +49,7 @@ | ||
49 | 49 | |
50 | 50 | #endif |
51 | 51 | |
52 | -const std::wstring c2w(const std::string &src) | |
52 | +std::wstring c2w(const std::string &src) | |
53 | 53 | { |
54 | 54 | #ifdef _WINDOWS |
55 | 55 | int bufSize = MultiByteToWideChar(CP_THREAD_ACP, 0, src.c_str(), -1, NULL, 0); |
@@ -72,7 +72,7 @@ | ||
72 | 72 | #endif |
73 | 73 | } |
74 | 74 | |
75 | -const std::string w2c(const std::wstring &src) | |
75 | +std::string w2c(const std::wstring &src) | |
76 | 76 | { |
77 | 77 | #ifdef _WINDOWS |
78 | 78 | int bufSize = WideCharToMultiByte(CP_THREAD_ACP, 0, src.c_str(), -1, NULL, 0, NULL, NULL); |
@@ -101,7 +101,7 @@ | ||
101 | 101 | 将来的には消す必要あり |
102 | 102 | */ |
103 | 103 | |
104 | -std::tstring PtrToHex(const void *const value) | |
104 | +std::tstring PtrToHex(const void* value) | |
105 | 105 | { |
106 | 106 | std::tstringstream strm; |
107 | 107 | strm << std::hex << std::setfill(TEXT('0')) << std::setw(sizeof(void*) * 2) << value; |
@@ -108,13 +108,13 @@ | ||
108 | 108 | return strm.str(); |
109 | 109 | } |
110 | 110 | |
111 | -std::tstring TimeToStr(time_t t){ | |
111 | +std::tstring TimeToStr(std::time_t t) | |
112 | +{ | |
112 | 113 | TCHAR buffer[16]; |
113 | 114 | #if defined(_MSC_VER) && !defined(WINCE) |
114 | - //TODO:エラーチェックはとりあえず放置 | |
115 | 115 | tm tmp; |
116 | - localtime_s(&tmp,&t); | |
117 | - _tcsftime(buffer,ARRAYSIZE(buffer),TEXT("%H:%M:%S"), &tmp); | |
116 | + localtime_s(&tmp, &t); | |
117 | + _tcsftime(buffer, ARRAYSIZE(buffer), TEXT("%H:%M:%S"), &tmp); | |
118 | 118 | #else |
119 | 119 | _tcsftime(buffer,sizeof(buffer)/sizeof(buffer[0]),TEXT("%H:%M:%S"), localtime(&t)); |
120 | 120 | #endif |
@@ -1,6 +1,7 @@ | ||
1 | -#include "UNsmCom.h" | |
2 | 1 | #include "APCQueue.h" |
3 | 2 | |
3 | +#include "UNsmCom.h" | |
4 | + | |
4 | 5 | #if defined(WIN32) && !defined(WINCE) |
5 | 6 | namespace Regnessem |
6 | 7 | { |
@@ -20,7 +21,7 @@ | ||
20 | 21 | |
21 | 22 | LONG_PTR ApcQueue::Call(HNsmService serviceHandle, WPARAM wParam, LPARAM lParam) |
22 | 23 | { |
23 | - CallServiceInfo cSInfo = {0}; | |
24 | + CallServiceInfo cSInfo = {}; | |
24 | 25 | cSInfo.ServiceHandle = serviceHandle; |
25 | 26 | cSInfo.wParam = wParam; |
26 | 27 | cSInfo.lParam = lParam; |
@@ -1,3 +1,5 @@ | ||
1 | +#include "nsmsgs.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | #if defined(_WINDOWS) |
3 | 5 | #include <windows.h> |
@@ -8,7 +10,6 @@ | ||
8 | 10 | #include "../../Common/tstring.h" |
9 | 11 | #include "../../Common/dummy.h" |
10 | 12 | |
11 | -#include "nsmsgs.h" | |
12 | 13 | #include "UFrmNsmMain.h" |
13 | 14 | #include "UFrmNsmMainDebug.h" |
14 | 15 | #include "UNsmCom.h" |
@@ -114,9 +115,8 @@ | ||
114 | 115 | #else |
115 | 116 | g_NsmCom.DebugMode = false; |
116 | 117 | #endif |
118 | + std::unique_ptr<NsmMain> FrmNsmMain; //仮置き | |
117 | 119 | |
118 | - std::auto_ptr<NsmMain> FrmNsmMain; //仮置き | |
119 | - | |
120 | 120 | if (!g_NsmCom.DebugMode) |
121 | 121 | { |
122 | 122 | FrmNsmMain.reset(new NsmMain()); |
@@ -1,9 +1,10 @@ | ||
1 | +#include "UNsmCom.h" | |
2 | + | |
1 | 3 | #include <algorithm> |
2 | 4 | |
3 | 5 | #include "../../Common/dummy.h" |
4 | 6 | |
5 | 7 | #include "APCQueue.h" |
6 | -#include "UNsmCom.h" | |
7 | 8 | |
8 | 9 | namespace Regnessem |
9 | 10 | { |
@@ -12,11 +13,11 @@ | ||
12 | 13 | NsmCom g_NsmCom; |
13 | 14 | // ----------------------------------------------------------------------------- |
14 | 15 | NsmCom::NsmCom() |
15 | - :MainThreadID(GetCurrentThreadId()), | |
16 | - DebugMode(false), | |
17 | - OnLog(NULL), | |
18 | - OnServiceListChange(NULL), | |
19 | - OnEventListChange(NULL) | |
16 | + :MainThreadID(GetCurrentThreadId()) | |
17 | + ,DebugMode() | |
18 | + ,OnLog() | |
19 | + ,OnServiceListChange() | |
20 | + ,OnEventListChange() | |
20 | 21 | { |
21 | 22 | DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &MainThreadHandle, 0, FALSE, DUPLICATE_SAME_ACCESS); |
22 | 23 | DebugWindow.reset(); |
@@ -261,17 +262,17 @@ | ||
261 | 262 | |
262 | 263 | TNsmPluginInitInfo NsmComHelper::GetPluginInitInfo() |
263 | 264 | { |
264 | - TNsmPluginInitInfo q; | |
265 | - q.cbSize = sizeof(TNsmPluginInitInfo); | |
266 | - q.CreateNsmService = CreateNsmService; | |
267 | - q.GetService = GetService; | |
268 | - q.CallService = CallService; | |
269 | - q.CreateNsmEvent = CreateNsmEvent; | |
270 | - q.GetEvent = GetEvent; | |
271 | - q.NotifyEvent = NotifyEvent; | |
272 | - q.HookEvent = HookEvent; | |
273 | - q.UnhookEvent = UnhookEvent; | |
274 | - return q; | |
265 | + TNsmPluginInitInfo info; | |
266 | + info.cbSize = sizeof(info); | |
267 | + info.CreateNsmService = CreateNsmService; | |
268 | + info.GetService = GetService; | |
269 | + info.CallService = CallService; | |
270 | + info.CreateNsmEvent = CreateNsmEvent; | |
271 | + info.GetEvent = GetEvent; | |
272 | + info.NotifyEvent = NotifyEvent; | |
273 | + info.HookEvent = HookEvent; | |
274 | + info.UnhookEvent = UnhookEvent; | |
275 | + return info; | |
275 | 276 | } |
276 | 277 | } |
277 | 278 | } |
@@ -1,3 +1,5 @@ | ||
1 | +#include "UNsmSystem.h" | |
2 | + | |
1 | 3 | #include <cassert> |
2 | 4 | #include <algorithm> |
3 | 5 |
@@ -9,7 +11,6 @@ | ||
9 | 11 | #include "UNsmCom.h" |
10 | 12 | #include "ModuleUtility.h" |
11 | 13 | #include "resource.h" |
12 | -#include "UNsmSystem.h" | |
13 | 14 | |
14 | 15 | namespace Regnessem |
15 | 16 | { |
@@ -308,7 +309,7 @@ | ||
308 | 309 | FILE*fp = popen(("dir "+path).c_str(),"r"); |
309 | 310 | char buf[256]; |
310 | 311 | while(fscanf(fp,"%255s",buf)==1){ |
311 | - std::auto_ptr<TNsmPlugin> t(buf)); | |
312 | + std::unique_ptr<TNsmPlugin> t(buf)); | |
312 | 313 | |
313 | 314 | if(t->DllHandle != NULL && |
314 | 315 | t->PluginInfo.ApiVersion == NSM_API_VERSION && |
@@ -1,4 +1,4 @@ | ||
1 | -/* NSM SYSTEM メインウィンドウ */ | |
1 | +#include "UFrmNsmMain.h" | |
2 | 2 | |
3 | 3 | #include <algorithm> |
4 | 4 |
@@ -13,7 +13,6 @@ | ||
13 | 13 | |
14 | 14 | #include "nsmsgs.h" |
15 | 15 | #include "UNsmSystem.h" |
16 | -#include "UFrmNsmMain.h" | |
17 | 16 | |
18 | 17 | #define RS_ERROR_NOUIMODULE TEXT("UI モジュールが見つかりませんでした。\nPlugins フォルダ内に UI モジュールが存在するか確認してください。") |
19 | 18 |
@@ -1,3 +1,5 @@ | ||
1 | +#include "UNsmPlugin.h" | |
2 | + | |
1 | 3 | #if !defined(_WINDOWS) |
2 | 4 | #include <iostream> |
3 | 5 | #endif |
@@ -5,7 +7,6 @@ | ||
5 | 7 | #include "../../Common/UNsmConsts.h" |
6 | 8 | #include "../../Common/dummy.h" |
7 | 9 | |
8 | -#include "UNsmPlugin.h" | |
9 | 10 | #include "DllUtils.h" |
10 | 11 | |
11 | 12 | namespace Regnessem |
@@ -1,9 +1,8 @@ | ||
1 | +#include "UNsmConnection.h" | |
1 | 2 | |
2 | 3 | #include "../../Common/dummy.h" |
3 | 4 | #include "../../Common/UNsmConsts.h" |
4 | 5 | |
5 | -#include "UNsmConnection.h" | |
6 | - | |
7 | 6 | namespace Regnessem |
8 | 7 | { |
9 | 8 | namespace System |
@@ -2,6 +2,8 @@ | ||
2 | 2 | #pragma comment(lib, "comctl32.lib") |
3 | 3 | #endif |
4 | 4 | |
5 | +#include "UFrmNsmMainDebug.h" | |
6 | + | |
5 | 7 | #include <ctime> |
6 | 8 | #include <windowsx.h> |
7 | 9 | #include <windows.h> |
@@ -14,7 +16,6 @@ | ||
14 | 16 | #include "UNsmSystem.h" |
15 | 17 | #include "resource.h" |
16 | 18 | #include "nsmsgs.h" |
17 | -#include "UFrmNsmMainDebug.h" | |
18 | 19 | |
19 | 20 | namespace Regnessem |
20 | 21 | { |
@@ -2,11 +2,11 @@ | ||
2 | 2 | // MSN7 表示メッセージ対応済み |
3 | 3 | // MSN7 表示アイコン仮対応 |
4 | 4 | |
5 | +#include "UNsmMemberList.h" | |
6 | + | |
5 | 7 | #include "../../Common/UNsmConsts.h" |
6 | 8 | #include "../../Common/dummy.h" |
7 | 9 | |
8 | -#include "UNsmMemberList.h" | |
9 | - | |
10 | 10 | namespace Regnessem |
11 | 11 | { |
12 | 12 | namespace System |
@@ -8,19 +8,19 @@ | ||
8 | 8 | |
9 | 9 | std::tstring ModuleUtility::ExtractModuleType(const std::tstring &moduleName) |
10 | 10 | { |
11 | - return moduleName.substr(0,moduleName.find(Delimiter)); | |
11 | + return moduleName.substr(0, moduleName.find(Delimiter)); | |
12 | 12 | } |
13 | 13 | |
14 | 14 | std::tstring ModuleUtility::ExtractProtocolName(const std::tstring &moduleName) |
15 | 15 | { |
16 | 16 | std::tstring::size_type p = moduleName.find(Delimiter); |
17 | - return moduleName.substr(p==moduleName.npos ? p : ++p); | |
17 | + return moduleName.substr(p == moduleName.npos ? p : ++p); | |
18 | 18 | } |
19 | 19 | |
20 | 20 | std::tstring ModuleUtility::ExtractAddInName(const std::tstring &moduleName) |
21 | 21 | { |
22 | 22 | std::tstring::size_type p = moduleName.find(Delimiter); |
23 | - return moduleName.substr(p==moduleName.npos ? p : ++p); | |
23 | + return moduleName.substr(p == moduleName.npos ? p : ++p); | |
24 | 24 | } |
25 | 25 | } |
26 | 26 | } |
@@ -30,7 +30,7 @@ | ||
30 | 30 | |
31 | 31 | //---- |
32 | 32 | |
33 | - std::auto_ptr<NsmMainDebug> DebugWindow; | |
33 | + std::unique_ptr<NsmMainDebug> DebugWindow; | |
34 | 34 | |
35 | 35 | //---- |
36 | 36 |
@@ -28,7 +28,7 @@ | ||
28 | 28 | typedef Common::DelphiCompatible::NotifyEvent NotifyEvent; |
29 | 29 | typedef std::vector<std::string> CommandParam; |
30 | 30 | |
31 | - std::auto_ptr<AddIn::ClientSocket::ClientSocketUtil> Socket; | |
31 | + std::unique_ptr<AddIn::ClientSocket::ClientSocketUtil> Socket; | |
32 | 32 | int MembersCount; |
33 | 33 | int ListCount; |
34 | 34 | int GroupsCount; |
@@ -46,7 +46,7 @@ | ||
46 | 46 | Common::DelphiCompatible::TTimer PingTimer; |
47 | 47 | |
48 | 48 | // パスワード情報取得用のスレッド |
49 | - std::auto_ptr<MsnAuthThread> AuthThread; | |
49 | + std::unique_ptr<MsnAuthThread> AuthThread; | |
50 | 50 | |
51 | 51 | // アカウント毎の情報 |
52 | 52 | std::string SYNString1; |
@@ -29,7 +29,7 @@ | ||
29 | 29 | MsnThreadFileSessionList m_FileSessions; |
30 | 30 | TSimpleTimer *m_TypingTimer; |
31 | 31 | |
32 | - std::auto_ptr<Common::NsmInfoUtility::NsmGetSetInfo> GetSetInfo; | |
32 | + std::unique_ptr<Common::NsmInfoUtility::NsmGetSetInfo> GetSetInfo; | |
33 | 33 | |
34 | 34 | HNsmEvent HComLogEvent; //TODO: rename |
35 | 35 | std::vector<std::tstring> m_HandWriteList; |
@@ -26,7 +26,7 @@ | ||
26 | 26 | typedef Common::DelphiCompatible::NotifyEvent NotifyEvent; |
27 | 27 | |
28 | 28 | // プロパティフィールド |
29 | - std::auto_ptr<AddIn::ClientSocket::ClientSocketUtil> Socket; | |
29 | + std::unique_ptr<AddIn::ClientSocket::ClientSocketUtil> Socket; | |
30 | 30 | std::string Host; |
31 | 31 | unsigned short Port; |
32 | 32 | MsnMemberList Members; |