From 26d2638f7478d97acd7d27dd6162e430ae91ca05 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 9 Feb 2024 03:28:07 +0000 Subject: [PATCH] API: fix usage of stl in parseFile --- include/hyprlang.hpp | 2 +- src/config.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hyprlang.hpp b/include/hyprlang.hpp index b43ed49..f549787 100644 --- a/include/hyprlang.hpp +++ b/include/hyprlang.hpp @@ -274,7 +274,7 @@ namespace Hyprlang { Same as parse(), but parse a specific file, without any refreshing. recommended to use for stuff like source = path.conf */ - CParseResult parseFile(std::string file); + CParseResult parseFile(const char* file); /*! Parse a single "line", dynamically. diff --git a/src/config.cpp b/src/config.cpp index be1f85c..213e963 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -506,12 +506,12 @@ CParseResult CConfig::parse() { if (impl->path.empty()) return CParseResult{}; - CParseResult fileParseResult = parseFile(impl->path); + CParseResult fileParseResult = parseFile(impl->path.c_str()); return fileParseResult; } -CParseResult CConfig::parseFile(std::string file) { +CParseResult CConfig::parseFile(const char* file) { CParseResult result; std::ifstream iffile(file);