libzypp 17.31.23
|
Classes | |
class | TimeoutException |
Typedefs | |
using | timeout_type = size_t |
Enumerations | |
enum class | BlockingMode { FailedToSetMode = -1 , WasBlocking , WasNonBlocking } |
enum class | ReadAllResult { Error , Eof , Ok } |
enum | ReceiveUpToResult { Success , Timeout , EndOfFile , Error } |
Functions | |
BlockingMode | setFILEBlocking (FILE *file, bool mode=true) |
Enables or disabled non blocking mode on a file descriptor. | |
BlockingMode | setFDBlocking (int fd, bool mode) |
bool | writeAll (int fd, void *buf, size_t size) |
ReadAllResult | readAll (int fd, void *buf, size_t size) |
std::pair< ReceiveUpToResult, std::string > | receiveUpto (FILE *file, char c, timeout_type timeout, bool failOnUnblockError) |
Variables | |
static const timeout_type | no_timeout = static_cast<timeout_type>(-1) |
using zypp::io::timeout_type = typedef size_t |
|
strong |
|
strong |
BlockingMode zypp::io::setFILEBlocking | ( | FILE * | file, |
bool | mode = true |
||
) |
Enables or disabled non blocking mode on a file descriptor.
The return value is one of the zypp::io::BlockingMode values
Definition at line 25 of file IOTools.cc.
BlockingMode zypp::io::setFDBlocking | ( | int | fd, |
bool | mode | ||
) |
Definition at line 31 of file IOTools.cc.
bool zypp::io::writeAll | ( | int | fd, |
void * | buf, | ||
size_t | size | ||
) |
Blocks until all data in buf was written to the fd or a error occured
Definition at line 55 of file IOTools.cc.
ReadAllResult zypp::io::readAll | ( | int | fd, |
void * | buf, | ||
size_t | size | ||
) |
Definition at line 69 of file IOTools.cc.
std::pair< ReceiveUpToResult, std::string > zypp::io::receiveUpto | ( | FILE * | file, |
char | c, | ||
timeout_type | timeout, | ||
bool | failOnUnblockError = true |
||
) |
Reads data from file until it finds a seperator c, hits the end of the file or times out. The timeout value is specified in milliseconds, a timeout of -1 means no timeout. If failOnUnblockError is set to false the function will not error out if unblocking the file descriptor did not work. The default is to fail if it's not possible to unblock the file.
Definition at line 85 of file IOTools.cc.
|
static |