From cb7e83aa4ed48df3e1bb259b26737feaf5a0d676 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 9 Dec 2018 15:57:42 +0000 Subject: Move some config parser-internal types out of the public header. --- include/configparser.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'include') diff --git a/include/configparser.h b/include/configparser.h index c9790c59f..680f11a61 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -19,25 +19,6 @@ #pragma once -struct fpos -{ - std::string filename; - int line; - int col; - fpos(const std::string& name, int l = 1, int c = 1) : filename(name), line(l), col(c) {} - std::string str() - { - return filename + ":" + ConvToStr(line) + ":" + ConvToStr(col); - } -}; - -enum ParseFlags -{ - FLAG_USE_COMPAT = 1, - FLAG_NO_EXEC = 2, - FLAG_NO_INC = 4 -}; - struct ParseStack { std::vector reading; @@ -57,23 +38,3 @@ struct ParseStack void DoInclude(ConfigTag* includeTag, int flags); void DoReadFile(const std::string& key, const std::string& file, int flags, bool exec); }; - -/** RAII wrapper on FILE* to close files on exceptions */ -struct FileWrapper -{ - FILE* const f; - bool close_with_pclose; - FileWrapper(FILE* file, bool use_pclose = false) : f(file), close_with_pclose(use_pclose) {} - operator bool() { return (f != NULL); } - operator FILE*() { return f; } - ~FileWrapper() - { - if (f) - { - if (close_with_pclose) - pclose(f); - else - fclose(f); - } - } -}; -- cgit v1.3.1-10-gc9f91