config_parser: Add support for checking file existence
This will be used to reduce the number of config parser errors printed
to the logs.
Change-Id: Ia0337da386bc5dbe32c04bf2c3264997a9ad6da1
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/config_parser.hpp b/src/config_parser.hpp
index 5d98f52..5df8d98 100644
--- a/src/config_parser.hpp
+++ b/src/config_parser.hpp
@@ -168,6 +168,12 @@
*/
Parser(const fs::path& filename);
+ /** @brief Determine if the loaded file exists */
+ inline bool getFileExists() const noexcept
+ {
+ return fileExists;
+ }
+
/** @brief Determine if there were warnings parsing the file
* @return The number of parsing issues in the file
*/
@@ -194,6 +200,7 @@
void writeFile(const fs::path& filename);
private:
+ bool fileExists = false;
fs::path filename;
std::vector<std::string> warnings;
};