From e46082608499d2870e80b645485cdd40834cf314 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 25 Apr 2019 22:32:39 +0900 Subject: [PATCH] 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(). --- toml/value.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toml/value.hpp b/toml/value.hpp index ef4bd15..9af4040 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -607,6 +607,19 @@ class value template typename detail::toml_default_type::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