emitter: Support std::string_view

Accept Emitter::operator<<(std::string_view).

ABI remains C++11 compatible by exposing new method
Emitter::Write(const char*, size_t).

All affected calls optimized to pass std::string values as pointer + size
tuple into appropriate routines.
This commit is contained in:
Daniel Levin
2024-10-20 00:36:24 -05:00
committed by Jesse Beder
parent 8a9a7b74ef
commit 7470c2d871
9 changed files with 107 additions and 60 deletions

View File

@@ -94,7 +94,7 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
tag = (token.type == Token::NON_PLAIN_SCALAR ? "!" : "?");
if (token.type == Token::PLAIN_SCALAR
&& tag.compare("?") == 0 && IsNullString(token.value)) {
&& tag.compare("?") == 0 && IsNullString(token.value.data(), token.value.size())) {
eventHandler.OnNull(mark, anchor);
m_scanner.pop();
return;