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:
tolowerconvert text to lower casetoupperconvert text to upper casebreaklinefold 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.
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.