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:
ToruNiina
2019-04-25 22:32:39 +09:00
parent aa3445f38c
commit e460826084

View File

@@ -607,6 +607,19 @@ class value
template<value_t T>
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:
void cleanup() noexcept