renamed buffer accessors; added accessors for socketstream members
This commit is contained in:
parent
8d327cb1d2
commit
027f9cb59e
16
libscio.hpp
16
libscio.hpp
@ -41,8 +41,8 @@ namespace sc {
|
|||||||
fdostream(int fd) : std::ostream(&_outbuf), _outbuf(fd) {}
|
fdostream(int fd) : std::ostream(&_outbuf), _outbuf(fd) {}
|
||||||
fdostream() : std::ostream(&_outbuf), _outbuf(-1) {}
|
fdostream() : std::ostream(&_outbuf), _outbuf(-1) {}
|
||||||
|
|
||||||
int fd() const { return _outbuf.fd(); }
|
int ofd() const { return _outbuf.fd(); }
|
||||||
void fd(int fd) { _outbuf.fd(fd); }
|
void ofd(int fd) { _outbuf.fd(fd); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
fdoutbuf _outbuf;
|
fdoutbuf _outbuf;
|
||||||
@ -69,8 +69,8 @@ namespace sc {
|
|||||||
fdistream(int fd) : std::istream(&_inbuf), _inbuf(fd) {}
|
fdistream(int fd) : std::istream(&_inbuf), _inbuf(fd) {}
|
||||||
fdistream() : std::istream(&_inbuf), _inbuf(-1) {}
|
fdistream() : std::istream(&_inbuf), _inbuf(-1) {}
|
||||||
|
|
||||||
int fd() const { return _inbuf.fd(); }
|
int ifd() const { return _inbuf.fd(); }
|
||||||
void fd(int fd) { _inbuf.fd(fd); }
|
void ifd(int fd) { _inbuf.fd(fd); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
fdinbuf _inbuf;
|
fdinbuf _inbuf;
|
||||||
@ -118,6 +118,14 @@ namespace sc {
|
|||||||
struct sockaddr_storage* endpoint) const;
|
struct sockaddr_storage* endpoint) const;
|
||||||
socket_address address_from_endpoint(const struct sockaddr* endpoint) const;
|
socket_address address_from_endpoint(const struct sockaddr* endpoint) const;
|
||||||
|
|
||||||
|
// getters & setters
|
||||||
|
int socket() const { return _socket; }
|
||||||
|
void socket(int sock);
|
||||||
|
int domain() const { return _domain; }
|
||||||
|
void domain(int dom) { _domain = dom; }
|
||||||
|
int type() const { return _type; }
|
||||||
|
void type(int typ) { _type = typ; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _socket {-1};
|
int _socket {-1};
|
||||||
int _domain {0};
|
int _domain {0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user