Skip to content

Commit ac9c8f2

Browse files
committed
Update: 修改配置表加载目录
1 parent a967116 commit ac9c8f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/plugin/core/config/class_module.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
#include <algorithm>
77
#include <iostream>
88
#include <time.h>
9-
ClassModule::ClassModule() { mConfigFileName = "res/XlsxXML/Root.xml"; }
9+
#define XML_CONFIG_PATH "res/XlsxGen/XML"
10+
ClassModule::ClassModule() { mConfigFileName = XML_CONFIG_PATH "/Root.xml"; }
1011

1112
ClassModule::ClassModule(IPluginManager *p) {
1213
pm_ = p;
13-
mConfigFileName = "res/XlsxXML/Root.xml";
14-
14+
mConfigFileName = XML_CONFIG_PATH "/Root.xml";
1515
#ifdef DEBUG
1616
std::cout << "Using [" << pm_->GetWorkPath() << "/" + mConfigFileName << "]" << std::endl;
1717
#endif
18-
18+
1919
if (!this->mbBackup) {
2020
for (int i = 0; i < CONFIG_DATA_THREADS_CAN_BE_USED_CNT; ++i) {
2121
ThreadClassModule threadElement;
@@ -320,10 +320,12 @@ bool ClassModule::Load(rapidxml::xml_node<> *attrNode, std::shared_ptr<IClass> p
320320
const char *pstrPath = attrNode->first_attribute("Path")->value();
321321
const char *pstrInstancePath = attrNode->first_attribute("InstancePath")->value();
322322

323-
std::string realPath = pm_->GetWorkPath() + "/res/XlsxXML/";
323+
std::string realPath = pm_->GetWorkPath() + "/" + XML_CONFIG_PATH;
324+
realPath += "/";
324325
realPath += pstrPath;
325326

326-
std::string realInstancePath = pm_->GetWorkPath() + "/res/XlsxXML/";
327+
std::string realInstancePath = pm_->GetWorkPath() + "/" +XML_CONFIG_PATH;
328+
realInstancePath += "/";
327329
realInstancePath += pstrInstancePath;
328330

329331
// printf( "-----------------------------------------------------\n");

0 commit comments

Comments
 (0)