mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
feat: enable to get a comment related to a value
- comment_before(): get comments just before a value. - comment_inline(): get a comment in the same line as a value. - comment(): get comment_before() + comment_inline().
This commit is contained in:
@@ -607,6 +607,19 @@ class value
|
|||||||
template<value_t T>
|
template<value_t T>
|
||||||
typename detail::toml_default_type<T>::type&& cast() &&;
|
typename detail::toml_default_type<T>::type&& cast() &&;
|
||||||
|
|
||||||
|
std::string comment() const
|
||||||
|
{
|
||||||
|
return this->region_info_->comment();
|
||||||
|
}
|
||||||
|
std::string comment_before() const
|
||||||
|
{
|
||||||
|
return this->region_info_->comment_before();
|
||||||
|
}
|
||||||
|
std::string comment_inline() const
|
||||||
|
{
|
||||||
|
return this->region_info_->comment_inline();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void cleanup() noexcept
|
void cleanup() noexcept
|
||||||
|
Reference in New Issue
Block a user