From 11dd7306d32fb897a108c34c41c1860044b94c26 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 11 Dec 2024 01:01:00 -0500 Subject: [PATCH] Remove unused parser_util --- include/lib/fex/parser_util.h | 19 ------------- porymap.pro | 2 -- src/lib/fex/parser_util.cpp | 50 ----------------------------------- 3 files changed, 71 deletions(-) delete mode 100644 include/lib/fex/parser_util.h delete mode 100644 src/lib/fex/parser_util.cpp diff --git a/include/lib/fex/parser_util.h b/include/lib/fex/parser_util.h deleted file mode 100644 index 58ff89fc..00000000 --- a/include/lib/fex/parser_util.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef PARSER_UTIL_H -#define PARSER_UTIL_H - -#include -#include - -class ParserUtil -{ -public: - ParserUtil(QString root); - QStringList ReadDefines(QString filename, QString prefix); - QStringList ReadDefinesValueSort(QString filename, QString prefix); - -private: - QString root_; -}; - - -#endif // PARSER_UTIL_H diff --git a/porymap.pro b/porymap.pro index 1b1c693e..5734fd73 100644 --- a/porymap.pro +++ b/porymap.pro @@ -44,7 +44,6 @@ SOURCES += src/core/block.cpp \ src/core/editcommands.cpp \ src/lib/fex/lexer.cpp \ src/lib/fex/parser.cpp \ - src/lib/fex/parser_util.cpp \ src/lib/orderedjson.cpp \ src/core/regionmapeditcommands.cpp \ src/scriptapi/apimap.cpp \ @@ -150,7 +149,6 @@ HEADERS += include/core/block.h \ include/lib/fex/define_statement.h \ include/lib/fex/lexer.h \ include/lib/fex/parser.h \ - include/lib/fex/parser_util.h \ include/lib/orderedmap.h \ include/lib/orderedjson.h \ include/ui/aboutporymap.h \ diff --git a/src/lib/fex/parser_util.cpp b/src/lib/fex/parser_util.cpp deleted file mode 100644 index 0f375b81..00000000 --- a/src/lib/fex/parser_util.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "lib/fex/parser_util.h" - -#include - -#include "lib/fex/parser.h" - -ParserUtil::ParserUtil(QString root): root_(root) {} - -QStringList ParserUtil::ReadDefines(QString filename, QString prefix) -{ - if (filename.isEmpty()) { - return QStringList(); - } - - QString filepath = root_ + "/" + filename; - - fex::Parser parser; - - std::vector match_list = { prefix.toStdString() + ".*" }; - std::map defines = parser.ReadDefines(filepath.toStdString(), match_list); - - QStringList out; - for(auto const& define : defines) { - out.append(QString::fromStdString(define.first)); - } - - return out; -} - -QStringList ParserUtil::ReadDefinesValueSort(QString filename, QString prefix) -{ - - if (filename.isEmpty()) { - return QStringList(); - } - - QString filepath = root_ + "/" + filename; - - fex::Parser parser; - - std::vector match_list = { prefix.toStdString() + ".*" }; - std::map defines = parser.ReadDefines(filepath.toStdString(), match_list); - - QMultiMap defines_keyed_by_value; - for (const auto& pair : defines) { - defines_keyed_by_value.insert(pair.second, QString::fromStdString(pair.first)); - } - - return defines_keyed_by_value.values(); -}