45 operator const T &()
const &
60 return std::move(value_);
68 [[nodiscard]]
const T &
value() const &
80 return std::move(value_);
94 [[nodiscard]]
const std::string &
name()
const
110 [[nodiscard]]
const std::string &
source()
const
126 return source_details_;
155 [[nodiscard]] std::pair<std::vector<std::string>, std::vector<std::vector<FormatParam>>>
format_data()
const
161 std::vector<std::string> err_text{};
162 std::vector<std::vector<FormatParam>> params{};
164 err_text.emplace_back(
"{} = {}");
168 err_text.emplace_back(
"Source: {}");
173 err_text.emplace_back(
"");
174 params.emplace_back();
175 std::ranges::copy(
source_details(), std::back_inserter(err_text));
177 params.emplace_back();
181 return {err_text, params};
188 std::vector<std::string> source_details_;
A container that wraps a configuration value with its name and source information.
T && value() &&
Gets an rvalue reference to the underlying value.
const std::vector< std::string > & source_details() const
Gets the source details for this configuration value.
ConfigValue(T value, std::string name, std::string source, const std::vector< std::string > &source_details)
Constructs a ConfigValue with a value, name, and source information.
const T & value() const &
Gets a const reference to the underlying value.
std::pair< std::vector< std::string >, std::vector< std::vector< FormatParam > > > format_data() const
Generates formatted text data for displaying this configuration value.
const std::string & name() const
Gets the name of this configuration value.
const std::string & source() const
Gets the source information for this configuration value.
@ italic
Italic text formatting.
@ bold
Bold text formatting.
@ yellow
Yellow text color.