MCPcopy Create free account
hub / github.com/catboost/catboost / ReadQuotedString

Method ReadQuotedString

library/cpp/yson/detail.h:471–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469 }
470
471 void ReadQuotedString(TStringBuf* value) {
472 Buffer_.clear();
473 while (true) {
474 if (TBaseStream::IsEmpty()) {
475 TBaseStream::Refresh();
476 }
477 char ch = *TBaseStream::Begin();
478 TBaseStream::Advance(1);
479 if (ch != '"') {
480 Buffer_.push_back(ch);
481 } else {
482 // We must count the number of '\' at the end of StringValue
483 // to check if it's not \"
484 int slashCount = 0;
485 int length = Buffer_.size();
486 while (slashCount < length && Buffer_[length - 1 - slashCount] == '\\') {
487 ++slashCount;
488 }
489 if (slashCount % 2 == 0) {
490 break;
491 } else {
492 Buffer_.push_back(ch);
493 }
494 }
495 CheckMemoryLimit();
496 }
497
498 auto unquotedValue = UnescapeC(Buffer_.data(), Buffer_.size());
499 Buffer_.clear();
500 Buffer_.insert(Buffer_.end(), unquotedValue.data(), unquotedValue.data() + unquotedValue.size());
501 CheckMemoryLimit();
502 *value = TStringBuf(Buffer_.data(), Buffer_.size());
503 }
504
505 template <bool AllowFinish>
506 void ReadUnquotedString(TStringBuf* value) {

Callers

nothing calls this directly

Calls 10

BeginClass · 0.85
IsEmptyFunction · 0.50
AdvanceFunction · 0.50
UnescapeCFunction · 0.50
clearMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected