#include <cpp-terminal/private/file.hpp>
|
static const constexpr char * | m_file {"CONOUT$"} |
|
Definition at line 56 of file file.hpp.
◆ OutputFileHandler() [1/3]
Term::Private::OutputFileHandler::OutputFileHandler |
( |
std::recursive_mutex & | io_mutex | ) |
|
|
explicitnoexcept |
Definition at line 98 of file file.cpp.
100{
101
102}
103catch(...)
104{
106}
FileHandler(std::recursive_mutex &mutex, const std::string &file, const std::string &mode) noexcept
static const constexpr char * m_file
void ExceptionHandler(const ExceptionDestination &destination=ExceptionDestination::StdErr) noexcept
◆ OutputFileHandler() [2/3]
Term::Private::OutputFileHandler::OutputFileHandler |
( |
const OutputFileHandler & | other | ) |
|
|
delete |
◆ OutputFileHandler() [3/3]
◆ ~OutputFileHandler()
Term::Private::OutputFileHandler::~OutputFileHandler |
( |
| ) |
|
|
overridedefault |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ write() [1/2]
std::size_t Term::Private::OutputFileHandler::write |
( |
const char & | character | ) |
const |
Definition at line 143 of file file.cpp.
144{
145#if defined(_WIN32)
146 DWORD written{0};
147 Term::Private::WindowsError().check_if(0 == WriteConsole(
handle(), &character, 1, &written,
nullptr)).throw_exception(
"WriteConsole(handle(), &character, 1, &written, nullptr)");
148 return static_cast<std::size_t>(written);
149#else
150 ssize_t written{0};
151 Term::Private::Errno().check_if((written =
::write(
fd(), &character, 1)) == -1).throw_exception(
"::write(fd(), &character, 1)");
152 return static_cast<std::size_t>(written);
153#endif
154}
Handle handle() const noexcept
std::int32_t fd() const noexcept
std::size_t write(const std::string &str) const
◆ write() [2/2]
std::size_t Term::Private::OutputFileHandler::write |
( |
const std::string & | str | ) |
const |
Definition at line 130 of file file.cpp.
131{
132#if defined(_WIN32)
133 DWORD written{0};
134 if(!str.empty()) { Term::Private::WindowsError().check_if(0 == WriteConsole(
handle(), &str[0],
static_cast<DWORD
>(str.size()), &written,
nullptr)).throw_exception(
"WriteConsole(handle(), &str[0], static_cast<DWORD>(str.size()), &written, nullptr)"); }
135 return static_cast<std::size_t>(written);
136#else
137 ssize_t written{0};
138 if(!str.empty()) { Term::Private::Errno().check_if((written =
::write(
fd(), str.data(), str.size())) == -1).throw_exception(
"::write(fd(), str.data(), str.size())"); }
139 return static_cast<std::size_t>(written);
140#endif
141}
◆ m_file
const constexpr char* Term::Private::OutputFileHandler::m_file {"CONOUT$"} |
|
staticconstexpr |
The documentation for this class was generated from the following files: