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

Method ReadStream

util/system/shellcommand.cpp:423–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421 }
422
423 inline static void* ReadStream(void* data) noexcept {
424 TPipePump* pump = reinterpret_cast<TPipePump*>(data);
425 try {
426 int bytes = 0;
427 TBuffer buffer(DATA_BUFFER_SIZE);
428
429 while (true) {
430 bytes = pump->Pipe->Read(buffer.Data(), buffer.Capacity());
431 if (bytes > 0) {
432 pump->OutputStream->Write(buffer.Data(), bytes);
433 } else {
434 break;
435 }
436 }
437 if (pump->Pipe->IsOpen()) {
438 pump->Pipe->Close();
439 }
440 } catch (...) {
441 pump->InternalError = CurrentExceptionMessage();
442 }
443 return nullptr;
444 }
445
446 inline static void* WriteStream(void* data) noexcept {
447 TPipePump* pump = reinterpret_cast<TPipePump*>(data);

Callers

nothing calls this directly

Calls 7

CurrentExceptionMessageFunction · 0.85
ReadMethod · 0.45
DataMethod · 0.45
CapacityMethod · 0.45
WriteMethod · 0.45
IsOpenMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected