From: <geo...@us...> - 2015-02-15 18:32:40
|
Revision: 7942 http://sourceforge.net/p/freeorion/code/7942 Author: geoffthemedio Date: 2015-02-15 18:32:39 +0000 (Sun, 15 Feb 2015) Log Message: ----------- Limited log file errors about failed substitution during parse to one line per file name. Modified Paths: -------------- branches/SDL_Migration_And_Dependencies_Updates/parse/Parse.cpp Modified: branches/SDL_Migration_And_Dependencies_Updates/parse/Parse.cpp =================================================================== --- branches/SDL_Migration_And_Dependencies_Updates/parse/Parse.cpp 2015-02-15 18:07:12 UTC (rev 7941) +++ branches/SDL_Migration_And_Dependencies_Updates/parse/Parse.cpp 2015-02-15 18:32:39 UTC (rev 7942) @@ -409,6 +409,8 @@ const sregex FILENAME_TEXT = -+_; // any character, one or more times, not greedy const sregex FILENAME_INSERTION = "include" >> *space >> "\"" >> (s1 = FILENAME_TEXT) >> "\"" >> *space >> _n; + std::set<std::string> missing_include_files; + void file_substitution(std::string& text, const boost::filesystem::path& file_search_path) { if (!boost::filesystem::is_directory(file_search_path)) { Logger().errorStream() << "File parsing include substitution given search path that is not a director: " << file_search_path.string(); @@ -426,7 +428,11 @@ std::string insert_file_contents; bool read_success = read_file(insert_file_path, insert_file_contents); if (!read_success) { - Logger().errorStream() << "File parsing include substitution failed to read file at path: " << insert_file_path.string(); + std::string missing_file_pathstring = insert_file_path.string(); + if (missing_include_files.find(missing_file_pathstring) == missing_include_files.end()) { + missing_include_files.insert(missing_file_pathstring); + Logger().errorStream() << "File parsing include substitution failed to read file at path: " << insert_file_path.string(); + } continue; } |