LegalizeAdulthood / string-algos

Boost string algorithm examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

string-algos

Boost string algorithm examples for the video Boost String Algorithms Library. The code builds a tool called Stringer that can operate on text files to perform the following commands:

  • tolower convert text to lower case
  • toupper convert text to upper case
  • breakline fold lines longer than 80 columns intelligently

The video/code demonstrates a little bit of test-driven development advice:

  • How to unit test logic in main
  • How to mock a std::function<> with google mock

The code obtains the boost string algorithms library from vcpkg with a manifest, vcpkg in a git submodule and a CMake preset to specify the location of the vcpkg toolchain file.

Building the Code

You need CMake 3.25 or later installed to build this code.

After cloning this repository, the following commands should build the code:

git submodule init
git submodule update
cmake --preset default
cmake --build ../build

You can specify a generator after cmake --preset default if you don't like the default generator for your platform.

The default build configuration (Debug, Release, etc.) varies by the type of generator used. See the documentation on CMake for more details.

About

Boost string algorithm examples


Languages

Language:C++ 82.2%Language:Perl 12.8%Language:CMake 5.0%