diff --git a/src/lib/zswapobject/zswapobject.cpp b/src/lib/zswapobject/zswapobject.cpp index f4111d5..5681e53 100644 --- a/src/lib/zswapobject/zswapobject.cpp +++ b/src/lib/zswapobject/zswapobject.cpp @@ -21,28 +21,28 @@ void ZSwapObject::CheckValueBool(const std::string& Name, const std::string& Value) const { - if (!std::regex_match(Value, std::regex("^[YN]$"))) throw std::invalid_argument(std::format("The requested value for the variable \"{0}\" is incorrect (only Y or N are supported)!", Name)); + if (!std::regex_match(Value, std::regex("^[YN]$"))) throw std::invalid_argument(std::format("The requested value for the option \"{0}\" is incorrect (only Y or N are supported)!", Name)); } void ZSwapObject::CheckValueEmpty(const std::string& Name, const std::string& Value) const { - if (Value.empty()) throw std::invalid_argument(std::format("The requested value for the variable \"{0}\" is empty!", Name)); + if (Value.empty()) throw std::invalid_argument(std::format("The requested value for the option \"{0}\" is empty!", Name)); } void ZSwapObject::CheckValueRange(const std::string& Name, const std::string& Value) const { - if (!std::regex_match(Value, std::regex("^\\d{1,2}|100$"))) throw std::invalid_argument(std::format("The requested value for the variable \"{0}\" is out of range [0..100]!", Name)); + if (!std::regex_match(Value, std::regex("^\\d{1,2}|100$"))) throw std::invalid_argument(std::format("The requested value for the option \"{0}\" is out of range [0..100]!", Name)); } void ZSwapObject::WriteLogEntry(const std::string& Name, const std::string& Value) const { - std::cout << std::format("Writing a new value \"{1}\" to the \"{0}\" variable.", Name, Value) << std::endl; + std::cout << std::format("The option \"{0}\" has been set to a new value of \"{1}\".", Name, Value) << std::endl; } void ZSwapObject::WriteZSwapValue(const std::string& Name, const std::string& Value) const { const std::string FullPath = ZSwapModuleParametersPath + Name; - if (!std::filesystem::exists(FullPath)) throw std::runtime_error(std::format("Configuring the variable \"{0}\" is not possible on the current kernel!", Name)); + if (!std::filesystem::exists(FullPath)) throw std::runtime_error(std::format("Configuring the option \"{0}\" is not possible on the current kernel!", Name)); std::ofstream ZSwapSysFs(FullPath); ZSwapSysFs << Value; }