6 shared_ptr<vector<string>> contentUPtr = std::make_shared<vector<string>>();
14 while(getline(file, line)) {
16 contentUPtr->push_back(line);
26 return move(contentUPtr);
32 shared_ptr<vector<float>> contentUPtr = std::make_shared<vector<float>>();
34 for(
auto& c: *contentStringSPtr) {
35 contentUPtr->push_back(stof(c));
38 return move(contentUPtr);
42 shared_ptr<std::map<std::string, std::string>> contentSPtr = std::make_shared<std::map<std::string, std::string>>();
45 file.open(p_filepath);
50 while(getline(file, line)) {
53 size_t lineDelimiterPosition = line.find(
"=");
54 if (lineDelimiterPosition == std::string::npos || lineDelimiterPosition == 0)
continue;
56 std::string key = line.substr(0, lineDelimiterPosition);
57 std::string value = line.substr(lineDelimiterPosition + 1, line.size());
59 if (contentSPtr->find(key) == contentSPtr->end())
60 contentSPtr->insert(std::pair<std::string, std::string>(key, value));
62 log_warning(
"[File] Duplicated Keys while loading config file: ", p_filepath);
69 throw std::runtime_error(
"Failed to open file.");