GithubHelp home page GithubHelp logo

fcccode / putils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phisko/putils

0.0 0.0 0.0 26.38 MB

Phiste's C++ Utilities

License: MIT License

C++ 65.01% CMake 3.21% C 22.34% Makefile 0.31% HTML 4.54% Shell 0.03% CSS 0.04% Roff 0.07% Python 3.34% Objective-C 0.23% GLSL 0.01% Objective-C++ 0.80% Batchfile 0.08%

putils's Introduction

putils

Phiste's C++ Utilities

Stand-alone utility classes

  • AbstractFactory Base class for a factory able to create any type in a given typelist calling make<T>().
  • CellularAutomaton Simple cellular automaton implementation
  • CLI Simple and extensible Command-Line Interface.
  • Directory An abstraction to Unix and Windows directories, which lets you iterate through a directory and get information about each file.
  • JSON JSON lexer and pretty-printer
  • NamedPipe Abstraction to named pipes
  • Observable A minimalistic (but greatly sufficient) implementation of the Observer pattern.
  • OperatorForward Mix-in class which lets you forward all operators to a given member.
  • Point Simple abstraction to a 2D or 3D point/rectangle.
  • Process Abstraction to a process (useful to run system commands and send them input/get their output)
  • RAII A class template able to perform RAII on any type.
  • ThreadPool Thread pool implementation
  • Timer Simple timer based on std::chrono.

Standard library replacements

  • string: fixed-size drop-in replacement for std::string
  • vector: fixed-size drop-in replacement for std::vector
  • function: fixed-size drop-in replacement for std::function

Packages

  • Lua (enabled with the PUTILS_BUILD_LUA CMake option)
  • Python (enabled with the PUTILS_BUILD_PYTHON CMake option)
  • Mediator (enabled with the PUTILS_BUILD_MEDIATOR CMake option)
  • Meta
  • PluginManager
  • PSE (enabled with the PUTILS_BUILD_PSE CMake option)
  • Reflection

PSE makes use of Conan for dependency management. The necessary packages will be automatically downloaded when you run CMake, but Conan must be installed separately by running:

pip install conan

Function-only headers

  • anonymous_variable.hpp: macro to define an anonymous variable
  • casts.hpp: static and dynamic casts for std::unique_ptr
  • chop.hpp: function removing any newline and carriage return characters from the end of a string.
  • concat.hpp: function taking any number of parameters and concatenating them into a string.
  • erase.hpp: function taking a container and a value and erasing the value from the container.
  • file_extension.hpp: function returning a file's extension
  • fwd.hpp: macro which calls std::forward for the correct type
  • get_current_dir.hpp: function which returns the current working directory as a string
  • get_last_error_as_string.hpp: function for Windows
  • go_to_bin_dir.hpp: function which takes argv[0] as parameter and changes the current working directory to that containing the executed file.
  • hash.hpp: Pre-defined hashers for enums and pairs
  • lengthof.hpp: macro returning the length of an array
  • lock_and_run.hpp: function which takes a mutex, a function and its parameters. Creates a scoped lock for the mutex and runs the function.
  • members.hpp: help with class members
  • rand.hpp: function using C++ 11's random number generation facilities
  • read_stream.hpp: function which extracts an entire std::istream to a std::string
  • regex.hpp: utilities to easily construct and match regexes through literal operators
  • remove_if.hpp: function taking a container and a predicate and calling std::remove_if
  • same_sign.hpp: function indicating whether two scalars have the same sign
  • sign.hpp: function returning -1, 0 or 1 depending on the sign of the parameter
  • to_string.hpp: uses a std::stringstream to serialize an object
  • traits.hpp: type traits
  • url.hpp: URL encoder and decoder
  • with.hpp: with macro mimicking the Kotlin construct

CMake tools

  • conan: lets you run conan commands directly from cmake
  • conan_helper: provides a helper macro to simply list conan dependencies
  • cotire: lets you easily set up precompiled-header and single-compilation-unit compilations to speed up builds

putils's People

Contributors

phisko 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.