Schematika tokenizer (facet object model version)
  • C++ 96.6%
  • CMake 3.4%
Find a file
2024-04-23 16:27:05 -04:00
.github/workflows xo-flatstring: github: wrong xo-cmake repo name :) 2024-04-23 16:27:05 -04:00
cmake xo-flatstring: build: + GNUInstallDirs 2024-04-16 21:38:27 -04:00
docs xo-flatstring: bugfixes + utest expansion 2024-04-17 18:09:53 -04:00
example xo-flatstring: undercap flastring_concat instead of char arrays 2024-04-18 13:27:06 -04:00
include/xo/flatstring xo-flatstring: + .append() methods 2024-04-23 10:34:37 -04:00
utest xo-flatstring: drop editor tmp from repo 2024-04-18 13:29:43 -04:00
.gitignore xo-flatstring: + .gitignore 2024-04-16 17:26:19 -04:00
CMakeLists.txt xo-flatstring: build: + GNUInstallDirs 2024-04-16 21:38:27 -04:00
LICENSE xo-flatstring: + LICENSE 2024-04-16 21:39:13 -04:00
README.md xo-flatstring: README: drop install detail for coverage build 2024-04-18 17:24:35 -04:00

flatstring library

Fixed-length no-allocation string implementation.

Features:

  • char array representation with maximum size set at compile time.
  • compile time construction from char array and string concatenation
  • pointer-free implementation, instances can be used as template arguments
  • To the extent practical, provides the same api as std::string: includes iterators, access methods, assignment, conversion operators.

Limitations:

  • requires c++20
  • not resizable.
  • does not support wide characters.
  • (asof April 2024) missing features: insert, erase, push_back, append, replace, find, compare, starts_with, ends_with, contains, substr.

Documentation

Getting started

Install dependencies

Clone xo-flatstring

$ cd ~/proj  # for example
$ git clone https://github.com/rconybea/xo-flatstring

build + install

$ cd xo-flatstring
$ mkdir .build
$ PREFIX=/usr/local   # for example
$ cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} -B .build
$ cmake --build .build
$ cmake --install .build

build documentation

$ cd xo-flatstring
$ cmake --build .build -- docs

When complete, point local browser to xo-flatstring/.build/docs/sphinx/index.html

build with test coverage

$ cd xo-flatstring
$ mkdir .build-ccov
$ cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=coverage -B .build-ccov
$ cmake --build .build-ccov

run coverage-enabled unit tests

$ cmake --build .build-ccov -- test

generate html+text coverage report

$ cmake --build .build-ccov -- ccov

browse to .build-ccov/ccov/html/index.html

LSP support

$ cd xo-flatstring
$ ln -s .build/compile_commands.json