| 4814 | } |
| 4815 | |
| 4816 | void JsonValueWriter::writeImpl( Catch::StringRef value, bool quote ) { |
| 4817 | if ( quote ) { m_os << '"'; } |
| 4818 | size_t current_start = 0; |
| 4819 | for ( size_t i = 0; i < value.size(); ++i ) { |
| 4820 | if ( needsEscape( value[i] ) ) { |
| 4821 | if ( current_start < i ) { |
| 4822 | m_os << value.substr( current_start, i - current_start ); |
| 4823 | } |
| 4824 | m_os << makeEscapeStringRef( value[i] ); |
| 4825 | current_start = i + 1; |
| 4826 | } |
| 4827 | } |
| 4828 | if ( current_start < value.size() ) { |
| 4829 | m_os << value.substr( current_start, value.size() - current_start ); |
| 4830 | } |
| 4831 | if ( quote ) { m_os << '"'; } |
| 4832 | } |
| 4833 | |
| 4834 | } // namespace Catch |
| 4835 |
nothing calls this directly
no test coverage detected