REDl3east / cstring_view

A header only library that is very similar to C++17 std::string_view, but written in C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cstring_view

Overview

A header only library that is very similar to C++17 std::string_view, but written in C.

Building Tests and Examples

mkdir build
cd build
cmake ..
make

Running Tests and Examples

Building from previous step will generate two directories, tests and examples. This is where the binaries are stored. Running the examples is as simple as running each outputted binary from the command line. You can easily run the tests with ctest command like so:

ctest --output-on-failure

The tests can be found in the tests directory and the examples can be found in the examples directory.

Including this library into your project

The library is header only, so you can easily add it to your project. Copy and paste sv.h into your project. You must also do:

   // Do this:
      #define SV_IMPLEMENTATION
   // before you include this file in *one* C or C++ file to create the implementation.
   
   // i.e. it should look like this:
   #include ...
   #include ...
   #include ...
   #define SV_IMPLEMENTATION
   #include "sv.h"

About

A header only library that is very similar to C++17 std::string_view, but written in C.


Languages

Language:C 63.6%Language:C++ 34.6%Language:CMake 1.7%