MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_stdin_string

Method get_stdin_string

platform/windows/os_windows.cpp:2087–2100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2085}
2086
2087String OS_Windows::get_stdin_string(int64_t p_buffer_size) {
2088 if (get_stdin_type() == STD_HANDLE_INVALID) {
2089 return String();
2090 }
2091
2092 Vector<uint8_t> data;
2093 data.resize(p_buffer_size);
2094 DWORD count = 0;
2095 if (ReadFile(GetStdHandle(STD_INPUT_HANDLE), data.ptrw(), data.size(), &count, nullptr)) {
2096 return String::utf8((const char *)data.ptr(), count).replace("\r\n", "\n").rstrip("\n");
2097 }
2098
2099 return String();
2100}
2101
2102PackedByteArray OS_Windows::get_stdin_buffer(int64_t p_buffer_size) {
2103 Vector<uint8_t> data;

Callers

nothing calls this directly

Calls 7

rstripMethod · 0.80
sizeMethod · 0.65
StringClass · 0.50
resizeMethod · 0.45
ptrwMethod · 0.45
replaceMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected