MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / file_input_adapter

Class file_input_adapter

dependencies/json/json.hpp:4822–4846  ·  view source on GitHub ↗

! Input adapter for stdio file access. This adapter read only 1 byte and do not use any buffer. This adapter is a very low level adapter. */

Source from the content-addressed store, hash-verified

4820 buffer. This adapter is a very low level adapter.
4821*/
4822class file_input_adapter
4823{
4824 public:
4825 using char_type = char;
4826
4827 JSON_HEDLEY_NON_NULL(2)
4828 explicit file_input_adapter(std::FILE* f) noexcept
4829 : m_file(f)
4830 {}
4831
4832 // make class move-only
4833 file_input_adapter(const file_input_adapter&) = delete;
4834 file_input_adapter(file_input_adapter&&) = default;
4835 file_input_adapter& operator=(const file_input_adapter&) = delete;
4836 file_input_adapter& operator=(file_input_adapter&&) = delete;
4837
4838 std::char_traits<char>::int_type get_character() noexcept
4839 {
4840 return std::fgetc(m_file);
4841 }
4842
4843 private:
4844 /// the file pointer to read from
4845 std::FILE* m_file;
4846};
4847
4848
4849/*!

Callers 1

input_adapterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected