incu or ++Unix
Posted 2000-12-19 12:00. Tagged project, c++.
Unix facilities for C++ programmers
The aim of ++Unix is to allow C++ programs to use Unix facilities, such as sockets, whose interface includes a lot of pointers and other low-level stuff, and might vary on different kinds of Unix, in a nice, simple and consistent way.
One of the goals:
There should be no need for preprocessor conditionals (#if
) other
than as include guards in a C++ programs that uses ++Unix.
<incu/log.hh>
Stream out to syslog as simply as to any ostream. Almost.
int
<incu/pipe.hh>
A pipe created in an object. Really just a constructor / destructor pair for convenience.
<incu/socket.hh>
Some classes to help out in using sockets. A client looks basically like this:
incu::SockaddrIn addr;
addr..;
incu::Socket ;
socket.;
ifstream ;
ofstream ;
<incu/system.hh>
<incu/time.hh>
Contains the classes TimeVal
, which is just a constructor for
struct timeval
, and Time
which works like a time_t, but more
convenient.
The following will print the current time in a user-friendly format:
cout << "Time is " << << endl;
<incu/error.hh>
Mainly used by the other parts of incu, a c_error
is thrown when
something goes wrong the errno
way.
Comments
This post is 23 years old, comments are disabled.