Home

Awesome

String Theory

<a href="https://github.com/zrax/string_theory/actions"> <img alt="GitHub Build Status" src="https://github.com/zrax/string_theory/workflows/CI-Build/badge.svg"/> </a> <a href="https://scan.coverity.com/projects/zrax-string_theory"> <img alt="Coverity Scan Build Status" src="https://scan.coverity.com/projects/8580/badge.svg"/> </a>

Introduction

String Theory is a flexible modern C++ library for string manipulation and storage. It stores data internally as UTF-8, for ease of use with existing C/C++ APIs. It can also handle conversion to and from UTF-16, UTF-32, and Latin-1, and has a variety of methods to simplify text manipulation.

In addition, String Theory includes a powerful and fast type-safe string formatter (ST::format), which can be extended with custom type formatters by end-user code.

You can find the full documentation online at https://github.com/zrax/string_theory/wiki.

Why another string library?

String Theory was originally developed to replace the half-dozen or so string types and string manipulation mini-libraries in the Plasma game engine. Because of the state of the code, it was designed primarily to reduce coding errors, provide an easy to use set of manipulation functionality with minimal surprises, handle Unicode text without a lot of overhead, and have reasonable performance. Many existing string libraries provide some subset of those features, but were hard to integrate well with Plasma, or didn't meet all of our needs. Therefore, plString (and later plFormat) were born. After it had matured a while, it seemed that other projects could benefit from the string library, and so it was ported out into its own stand-alone library, which is String Theory.

String Theory's features

String Theory is designed to provide:

What String Theory is NOT

Platform Support

string_theory supports a variety of platforms and compilers. As of March 2023, string_theory is tested and working on:

As of string_theory 3.0, support for some older compilers has been dropped. You'll need a compiler that supports most of C++11.

Contributing to String Theory

String Theory is Open Source software, licensed under the MIT license. Contributions are welcome, and may be submitted as issues and/or pull requests on GitHub: http://github.com/zrax/string_theory.

Some ideas for areas to contribute: