| 105 | |
| 106 | namespace { |
| 107 | struct Filepointer { |
| 108 | OpenMode mode; |
| 109 | nonneg int mode_indent{}; |
| 110 | enum class Operation : std::uint8_t {NONE, UNIMPORTANT, READ, WRITE, POSITIONING, OPEN, CLOSE, UNKNOWN_OP} lastOperation = Operation::NONE; |
| 111 | nonneg int op_indent{}; |
| 112 | enum class AppendMode : std::uint8_t { UNKNOWN_AM, APPEND, APPEND_EX }; |
| 113 | AppendMode append_mode = AppendMode::UNKNOWN_AM; |
| 114 | std::string filename; |
| 115 | explicit Filepointer(OpenMode mode_ = OpenMode::UNKNOWN_OM) |
| 116 | : mode(mode_) {} |
| 117 | }; |
| 118 | |
| 119 | const std::unordered_set<std::string> whitelist = { "clearerr", "feof", "ferror", "fgetpos", "ftell", "setbuf", "setvbuf", "ungetc", "ungetwc" }; |
| 120 | } |