GithubHelp home page GithubHelp logo

pombredanne / libixxx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gsauthof/libixxx

0.0 1.0 0.0 99 KB

Thin C++ wrapper around POSIX/Ansi-C/Unix/Linux functions

License: BSD 2-Clause "Simplified" License

C++ 95.65% CMake 2.75% Python 1.60%

libixxx's Introduction

Thin C++ wrapper around POSIX/Ansi-C/Unix/Linux functions.

Main rationale behind this is to simplify writing robust system code that does not miss checking any error condition.

2014-2018, Georg Sauthoff [email protected], BSD-2-Clause

Build Status

Design

  • All errors are reported via exceptions.
  • Return type is changed to void if the function just returns error codes.
  • Overloads are provided for some STL objects (e.g. std::string) where it makes sense.
  • Functions are added as needed.
  • The headers are also usable in a mingw environment (under Windows), i.e. some functions unavailable in mingw are disabled by the pre-processor and where it makes sense and (without too much pain) a thin compatibility wrapper is provided (cf. e.g. fsync()).

Example

#include <iostream>
#include <ixxx/ixxx.hh>

using namespace ixxx;
using namespace std;

int main(int argc, char **argv)
{
    if (argc<2) { cerr << "Missing argument\n"; return 1; }
    try {
        posix::unlink(argv[1]);
    } catch (const ixxx::sys_error& e) {
        cerr << "Error: " << e.what() << '\n';
    }
    return 0;
}

Compile

$ mkdir build
$ cd build
$ cmake ..
$ make

This creates the library and also the unittests. Execute the unittests via:

$ ./ut

Licence

2-clause BSD

libixxx's People

Contributors

gsauthof avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.