\brief Emit path of current field for debugging purposes
| 744 | |
| 745 | /// \brief Emit path of current field for debugging purposes |
| 746 | std::string Path() { |
| 747 | std::string path; |
| 748 | for (size_t i = 0; i < builder_stack_.size(); ++i) { |
| 749 | auto builder = builder_stack_[i]; |
| 750 | if (builder.kind == Kind::kArray) { |
| 751 | path += "/[]"; |
| 752 | } else { |
| 753 | auto struct_builder = Cast<Kind::kObject>(builder); |
| 754 | auto field_index = field_index_; |
| 755 | if (i + 1 < field_index_stack_.size()) { |
| 756 | field_index = field_index_stack_[i + 1]; |
| 757 | } |
| 758 | path += "/" + std::string(struct_builder->field_name(field_index)); |
| 759 | } |
| 760 | } |
| 761 | return path; |
| 762 | } |
| 763 | |
| 764 | protected: |
| 765 | template <typename Handler, typename Stream> |