Loading src/conf.cpp +7 −23 Original line number Diff line number Diff line Loading @@ -172,38 +172,22 @@ size_t confplus::Config::ConfigData::getElements() const{ confplus::Config::Config(const std::string &path) { firstData = nullptr; int i = 0,ii=path.length(); std::string mpath = CONFIGPATH; while (path[i++] != ':') { if (i == path.length() ){ ConfException err; err[ConfException::Critical] << "Cannot load library not delimter for protocol "; throw err; } } size_t deli = path.find(':'); while (path[ii--] != '.') { if (ii < 0) { ConfException err; err[ConfException::Critical] << "Cannot load library not delimter for protocol "; throw err; } } std::copy(path.begin(), path.begin() + deli, std::back_inserter(mpath)); std::string mpath= CONFIGPATH; mpath += ".so"; std::copy(path.begin(), path.begin() + (i - 1), std::back_inserter(mpath)); ++deli; std::string confpath = path.substr(deli, path.length() - deli); mpath += ".dll"; std::cout << "Loading backend: " << mpath << std::endl; ++i; std::string confpath; std::copy(path.begin()+(++i), path.end(), std::inserter<std::string>(confpath, confpath.begin())); _BackendData = LoadLibrary(TEXT(mpath.c_str())); if (!_BackendData) { ConfException err; Loading Loading
src/conf.cpp +7 −23 Original line number Diff line number Diff line Loading @@ -172,38 +172,22 @@ size_t confplus::Config::ConfigData::getElements() const{ confplus::Config::Config(const std::string &path) { firstData = nullptr; int i = 0,ii=path.length(); std::string mpath = CONFIGPATH; while (path[i++] != ':') { if (i == path.length() ){ ConfException err; err[ConfException::Critical] << "Cannot load library not delimter for protocol "; throw err; } } size_t deli = path.find(':'); while (path[ii--] != '.') { if (ii < 0) { ConfException err; err[ConfException::Critical] << "Cannot load library not delimter for protocol "; throw err; } } std::copy(path.begin(), path.begin() + deli, std::back_inserter(mpath)); std::string mpath= CONFIGPATH; mpath += ".so"; std::copy(path.begin(), path.begin() + (i - 1), std::back_inserter(mpath)); ++deli; std::string confpath = path.substr(deli, path.length() - deli); mpath += ".dll"; std::cout << "Loading backend: " << mpath << std::endl; ++i; std::string confpath; std::copy(path.begin()+(++i), path.end(), std::inserter<std::string>(confpath, confpath.begin())); _BackendData = LoadLibrary(TEXT(mpath.c_str())); if (!_BackendData) { ConfException err; Loading