Improve:ConfigBase include cleaner.
This commit is contained in:
parent
3f2bd025b4
commit
509142a0fa
|
@ -15,6 +15,9 @@
|
||||||
#include "ConfigBase.h"
|
#include "ConfigBase.h"
|
||||||
#include "IConfigBase.h"
|
#include "IConfigBase.h"
|
||||||
#include "ILog.h"
|
#include "ILog.h"
|
||||||
|
#include "StatusCode.h"
|
||||||
|
#include <memory>
|
||||||
|
#include <stdlib.h>
|
||||||
static bool ObjectCheck(void *object)
|
static bool ObjectCheck(void *object)
|
||||||
{
|
{
|
||||||
if (nullptr == object) {
|
if (nullptr == object) {
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#include "ConfigBaseCode.h"
|
#include "ConfigBaseCode.h"
|
||||||
|
#include "ConfigBase.h"
|
||||||
#include "ILog.h"
|
#include "ILog.h"
|
||||||
|
#include "StatusCode.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
static const char *ConfigCodeString[CONFIG_CODE_END - STATUS_CODE_END + 1] = {"CONFIG_CODE_PARAM_NOT_EXIST",
|
static const char *ConfigCodeString[CONFIG_CODE_END - STATUS_CODE_END + 1] = {"CONFIG_CODE_PARAM_NOT_EXIST",
|
||||||
"CONFIG_CODE_END"};
|
"CONFIG_CODE_END"};
|
||||||
|
|
|
@ -13,10 +13,16 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#include "ConfigBaseImpl.h"
|
#include "ConfigBaseImpl.h"
|
||||||
|
#include "ConfigBase.h"
|
||||||
#include "ConfigBaseCode.h"
|
#include "ConfigBaseCode.h"
|
||||||
#include "ILog.h"
|
#include "ILog.h"
|
||||||
|
#include "StatusCode.h"
|
||||||
|
#include <libconfig.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
constexpr int INVALID_RESULT = -1;
|
constexpr int INVALID_RESULT = -1;
|
||||||
|
@ -38,7 +44,8 @@ bool ConfigBaseImpl::OpenConfigFile(void)
|
||||||
if (FIEL_EXIST == access(mFileName.c_str(), F_OK)) {
|
if (FIEL_EXIST == access(mFileName.c_str(), F_OK)) {
|
||||||
if (!config_read_file(&mCfg, mFileName.c_str())) {
|
if (!config_read_file(&mCfg, mFileName.c_str())) {
|
||||||
LogError("Read file failed[%s].\n", mFileName.c_str());
|
LogError("Read file failed[%s].\n", mFileName.c_str());
|
||||||
fprintf(stderr, "%s:%d - %s\n", config_error_file(&mCfg), config_error_line(&mCfg), config_error_text(&mCfg));
|
fprintf(
|
||||||
|
stderr, "%s:%d - %s\n", config_error_file(&mCfg), config_error_line(&mCfg), config_error_text(&mCfg));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,10 @@
|
||||||
#include "IConfigBase.h"
|
#include "IConfigBase.h"
|
||||||
#include "ConfigBaseImpl.h"
|
#include "ConfigBaseImpl.h"
|
||||||
#include "ILog.h"
|
#include "ILog.h"
|
||||||
|
#include "StatusCode.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <memory>
|
||||||
|
#include <stdlib.h>
|
||||||
bool IConfigBase::OpenConfigFile(void)
|
bool IConfigBase::OpenConfigFile(void)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user