xo-umbrella2/xo-flatstring
Roland Conybeare fa57de89fe git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring
subrepo:
  subdir:   "xo-flatstring"
  merged:   "996c220e"
upstream:
  origin:   "git@github.com:Rconybea/xo-flatstring"
  branch:   "main"
  commit:   "996c220e"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 21:34:32 -04:00
..
.github/workflows git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
cmake git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
docs git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
example git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
include/xo/flatstring git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
utest git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
.gitignore git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
.gitrepo git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
CMakeLists.txt git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
LICENSE git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
README.md git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -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

Must invoke docs target explicitly to prepare documentation 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

For html test coverage browse to .build-ccov/ccov/html/index.html

install documentation only, along with test-coverage report

$ cmake --install .build-ccov --component Documentation

LSP support

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