MCPcopy Create free account
hub / github.com/LagPixelLOL/ChatGPTCLIBot / read_raw_stdin

Method read_raw_stdin

main/interface/cpp-terminal/platforms/input.cpp:13–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "../tty.hpp"
12
13char Term::Platform::read_raw_stdin() {
14 char c = static_cast<char>(getchar());
15 if (c >= 0) {
16 return c;
17 } else if (c == EOF) {
18 //In non-raw (blocking) mode this happens when the input file
19 //ends. In such a case, return the End of Transmission (EOT)
20 //character (Ctrl-D)
21 return 0x04;
22 } else {
23 throw Exception("getchar() failed.");
24 }
25}
26
27bool Term::Platform::read_raw(char* s) {
28 //Do nothing when TTY is not connected.

Callers

nothing calls this directly

Calls 1

ExceptionClass · 0.85

Tested by

no test coverage detected