@brief Get a string value from the given node and, if necessary, escape its contents. @param[in] node The target string YAML node. @param[out] is_escaped Whether the contents of an output string has been escaped. @return The (escaped) string node value.
| 11112 | /// @param[out] is_escaped Whether the contents of an output string has been escaped. |
| 11113 | /// @return The (escaped) string node value. |
| 11114 | typename BasicNodeType::string_type get_string_node_value(const BasicNodeType& node, bool& is_escaped) { |
| 11115 | FK_YAML_ASSERT(node.is_string()); |
| 11116 | |
| 11117 | const auto& s = node.as_str(); |
| 11118 | return yaml_escaper::escape(s.c_str(), s.c_str() + s.size(), is_escaped); |
| 11119 | } // LCOV_EXCL_LINE |
| 11120 | |
| 11121 | private: |
| 11122 | /// A temporal buffer for conversion from a scalar to a string. |
no test coverage detected