// // fdostream.cpp // libscio // // Created by Bob Polis at 2020-02-14 // Copyright (c) 2020 SwiftCoder. All rights reserved. // #include "libscio.hpp" #ifdef _MSC_VER #include #else #include #endif std::streambuf::int_type sc::io::fdoutbuf::overflow(std::streambuf::int_type c) { if (c != EOF) { if (::write(_fd, &c, 1) != 1) { return EOF; } } return c; } std::streamsize sc::io::fdoutbuf::xsputn(const char* s, std::streamsize num) { return ::write(_fd, s, num); }