@@ -22,15 +22,15 @@ CConfig_Json::~CConfig_Json()
2222// ////////////////////////////////////////////////////////////////////////
2323// 公用函数
2424// ////////////////////////////////////////////////////////////////////////
25- BOOL CConfig_Json::Config_Json_File (LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG *pSt_ServerConfig)
25+ bool CConfig_Json::Config_Json_File (LPCXSTR lpszConfigFile,XENGINE_SERVERCONFIG *pSt_ServerConfig)
2626{
27- Config_IsErrorOccur = FALSE ;
27+ Config_IsErrorOccur = false ;
2828
2929 if ((NULL == lpszConfigFile) || (NULL == pSt_ServerConfig))
3030 {
31- Config_IsErrorOccur = TRUE ;
31+ Config_IsErrorOccur = true ;
3232 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARAMENT;
33- return FALSE ;
33+ return false ;
3434 }
3535 JSONCPP_STRING st_JsonError;
3636 Json::Value st_JsonRoot;
@@ -39,9 +39,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
3939 FILE* pSt_File = _tfopen (lpszConfigFile, _T (" rb" ));
4040 if (NULL == pSt_File)
4141 {
42- Config_IsErrorOccur = TRUE ;
42+ Config_IsErrorOccur = true ;
4343 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARAMENT;
44- return FALSE ;
44+ return false ;
4545 }
4646 int nCount = 0 ;
4747 TCHAR tszMsgBuffer[4096 ];
@@ -59,9 +59,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
5959 std::unique_ptr<Json::CharReader> const pSt_JsonReader (st_JsonBuilder.newCharReader ());
6060 if (!pSt_JsonReader->parse (tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError))
6161 {
62- Config_IsErrorOccur = TRUE ;
62+ Config_IsErrorOccur = true ;
6363 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_PARSE;
64- return FALSE ;
64+ return false ;
6565 }
6666 _tcscpy (pSt_ServerConfig->tszIPAddr ,st_JsonRoot[" tszIPAddr" ].asCString ());
6767 _tcscpy (pSt_ServerConfig->tszTopic , st_JsonRoot[" tszTopic" ].asCString ());
@@ -72,9 +72,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
7272
7373 if (st_JsonRoot[" XMax" ].empty () || (6 != st_JsonRoot[" XMax" ].size ()))
7474 {
75- Config_IsErrorOccur = TRUE ;
75+ Config_IsErrorOccur = true ;
7676 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XMAX;
77- return FALSE ;
77+ return false ;
7878 }
7979 Json::Value st_JsonXMax = st_JsonRoot[" XMax" ];
8080 pSt_ServerConfig->st_XMax .nMaxClient = st_JsonXMax[" nMaxClient" ].asInt ();
@@ -86,19 +86,19 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
8686
8787 if (st_JsonRoot[" XTime" ].empty () || (2 != st_JsonRoot[" XTime" ].size ()))
8888 {
89- Config_IsErrorOccur = TRUE ;
89+ Config_IsErrorOccur = true ;
9090 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XTIME;
91- return FALSE ;
91+ return false ;
9292 }
9393 Json::Value st_JsonXTime = st_JsonRoot[" XTime" ];
9494 pSt_ServerConfig->st_XTime .nDBMonth = st_JsonXTime[" nDBMonth" ].asInt ();
9595 pSt_ServerConfig->st_XTime .nSessionTime = st_JsonXTime[" nSessionTime" ].asInt ();
9696
9797 if (st_JsonRoot[" XLog" ].empty () || (3 != st_JsonRoot[" XLog" ].size ()))
9898 {
99- Config_IsErrorOccur = TRUE ;
99+ Config_IsErrorOccur = true ;
100100 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XLOG;
101- return FALSE ;
101+ return false ;
102102 }
103103 Json::Value st_JsonXLog = st_JsonRoot[" XLog" ];
104104 pSt_ServerConfig->st_XLog .nMaxSize = st_JsonXLog[" MaxSize" ].asInt ();
@@ -107,9 +107,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
107107
108108 if (st_JsonRoot[" XSql" ].empty () || (4 != st_JsonRoot[" XSql" ].size ()))
109109 {
110- Config_IsErrorOccur = TRUE ;
110+ Config_IsErrorOccur = true ;
111111 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XSQL;
112- return FALSE ;
112+ return false ;
113113 }
114114 Json::Value st_JsonXSql = st_JsonRoot[" XSql" ];
115115 pSt_ServerConfig->st_XSql .nSQLPort = st_JsonXSql[" SQLPort" ].asInt ();
@@ -119,9 +119,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
119119
120120 if (st_JsonRoot[" XPass" ].empty () || (5 != st_JsonRoot[" XPass" ].size ()))
121121 {
122- Config_IsErrorOccur = TRUE ;
122+ Config_IsErrorOccur = true ;
123123 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XPASS;
124- return FALSE ;
124+ return false ;
125125 }
126126 Json::Value st_JsonXPass = st_JsonRoot[" XPass" ];
127127 pSt_ServerConfig->st_XPass .nTimeout = st_JsonXPass[" nTimeout" ].asInt ();
@@ -132,9 +132,9 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
132132
133133 if (st_JsonRoot[" XVer" ].empty ())
134134 {
135- Config_IsErrorOccur = TRUE ;
135+ Config_IsErrorOccur = true ;
136136 Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XVER;
137- return FALSE ;
137+ return false ;
138138 }
139139 Json::Value st_JsonXVer = st_JsonRoot[" XVer" ];
140140 pSt_ServerConfig->st_XVer .pStl_ListStorage = new list<tstring>;
@@ -143,5 +143,5 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
143143 {
144144 pSt_ServerConfig->st_XVer .pStl_ListStorage ->push_back (st_JsonXVer[i].asCString ());
145145 }
146- return TRUE ;
146+ return true ;
147147}
0 commit comments