对字符串设置值进行trim。
This commit is contained in:
parent
850d143366
commit
6d38c0254b
@ -1,5 +1,6 @@
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "Core/Logger.h"
|
#include "Core/Logger.h"
|
||||||
|
#include <boost/algorithm/string/trim.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
#include <boost/property_tree/xml_parser.hpp>
|
#include <boost/property_tree/xml_parser.hpp>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@ -39,6 +40,7 @@ void Settings::load() {
|
|||||||
|
|
||||||
m_server = ptree.get<std::string>("Application.HttpServer.Address");
|
m_server = ptree.get<std::string>("Application.HttpServer.Address");
|
||||||
m_documentRoot = ptree.get<std::string>("Application.HttpServer.DocumentRoot");
|
m_documentRoot = ptree.get<std::string>("Application.HttpServer.DocumentRoot");
|
||||||
|
boost::algorithm::trim(m_documentRoot);
|
||||||
} catch (const xml_parser_error &error) {
|
} catch (const xml_parser_error &error) {
|
||||||
LOG(error) << "parse " << SettingsFilePath << " failed: " << error.message();
|
LOG(error) << "parse " << SettingsFilePath << " failed: " << error.message();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user