/*! \file xstream/posix.h * * \brief POSIX helper objects and functions */ #ifndef __XSTREAM_POSIX_H #define __XSTREAM_POSIX_H #include #include #include namespace xstream{ /*! * \brief POSIX objects and functions */ namespace posix{ /*! * \brief stores a \c strftime format and returns a string representation of the current date * */ class date_format { public: std::string format; /*!< format string for strftime */ /*! * \brief construct specifying strftime format */ date_format(const std::string& format); std::string now() const; }; /*! * \brief checks the return code of a syscall and raises apropriate exception if needed * * \param code error code * \param call name of syscall * */ void check_return(const int code, const std::string& call); #if HAVE_FD /*! * \brief encapsulates a file descriptor * */ class fd { protected: int fdn; /*!< the actual file descriptor */ bool dest_close; /*