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

Method get_stdin_string

drivers/unix/os_unix.cpp:209–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209String OS_Unix::get_stdin_string(int64_t p_buffer_size) {
210 Vector<uint8_t> data;
211 data.resize(p_buffer_size);
212 if (fgets((char *)data.ptrw(), data.size(), stdin)) {
213 return String::utf8((char *)data.ptr()).replace("\r\n", "\n").rstrip("\n");
214 }
215 return String();
216}
217
218PackedByteArray OS_Unix::get_stdin_buffer(int64_t p_buffer_size) {
219 Vector<uint8_t> data;

Callers 2

debugMethod · 0.45

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