STLplus C++ Library Collection - Contents
Author: Andy Rushton

# STLplus C++ Library Collection

Website

## Contents

- Introduction
- General Documents
- Containers Library
- Persistence Library
- Portability Library
- Subsystems Library
- Strings Library

## Introduction

STLplus is a collection of libraries containing reusable C++ components. The library collection is intended for developers already familiar with the STL. It contains abstract data types to extend the STL, reusable subsystems, data persistence and portability components. The collection is general-purpose and portable between Windows and many different Unix platforms including MacOS X.

One of my aims when writing STLplus was that it must be stand-alone. That means you do not have to install any other libraries or products to make it work, except of course the C++ compiler of choice.

STLplus contains 5 libraries, most of which can be used independently of the other libraries in the collection. For details of dependencies between libraries and how to use libraries stand-alone, see the Building Guidelines.

## General Documents

These documents explain how to build and use the STLplus library collection and how to split the collection into stand-alone libraries. It also explains the set of platforms the libraries run on, the versions available and the license terms under which you can use the collection.

- Building and Using STLplus
- Porting State
- Version Numbers
- Change Log
- License
- Exceptions Policy
- Interfaces
- Safe Iterators

The documentation for the components is designed to act mainly as a user manual. There is no reference manual as such - instead, read the headers which are designed to be human-readable and have comments. I consider writing self-documenting and human-readable headers part of the job of programming. I have provided colourised copies of the headers as web pages and there is a link to these at the top of each component's web page.

## Containers Library

The containers library contains abstract data classes which expand on the STL as the name STLplus suggests. The data types provided are:

- Introduction to the containers library
- smart_ptr.hpp: Smart Pointer
- simple_ptr.hpp: Simple Pointer
- digraph.hpp: Directed Graph
- hash.hpp: Hash Table
- ntree.hpp: Rooted Ordered Tree
- matrix.hpp: 2-Dimensional Matrix
- triple.hpp: Triple
- foursome.hpp: Foursome

The containers library has no dependencies and so can be used as a stand-alone library. Furthermore, it is an include-only library - i.e. you only need to include the headers - there is nothing to compile before you can use it.

## Persistence Library

The persistence library contains a solution to the problem of data persistence for C++ data structures. The library allows any well-structured data structure to be dumped and restored. The same library can be used to store data structures in files or to transmit them over network connections. The persistence format is platform-independent (i.e. independent of the compiler, operating system and CPU architecture) and so can be used to transfer data structures between platforms.

- Introduction to the persistence library
- persistent_contexts.hpp: Persistence Context Classes
- persistent_basic.hpp: Persistence of Basic Types
- persistent_stl.hpp: Persistence of STL Containers
- persistent_stlplus.hpp: Persistence of STLplus Containers
- persistent_pointers.hpp: Persistence of Pointers
- persistent_shortcuts.hpp: Shortcut Functions
- Examples

The persistence library has a soft dependency on the containers and portability libraries. In stand-alone mode it will make all C and C++ types including the STL classes persistent. If it is compiled with the containers library, then it will make the classes of the STLplus containers persistent as well as all the other types supported. If it is compiled with the portability library, it will make the STLplus infinite-precision integer type inf persistent.

## Portability Library

The portability library provides platform-independent interfaces to platform-specific features. This is so that programs can be written to be inherently portable by using this library to access those features. The target platforms for portability are Windows NT/2k/XP/Vista and all flavours of Posix-compliant Unix, including all the flavours of Gnu/Linux on PCs, MacOS X on the Apple Macintosh, plus Solaris, HP-UX and AIX on engineering workstations. The target architectures are either 32-bit or 64-bit CPUs. The target compilers are Gnu's gcc (for Gnu/Linux, MacOS and Windows) and Microsoft's Visual Studio (for Windows).

The components provided are:

- Introduction to the portability library
- portability_fixes.hpp: Fixes for OS- & compiler-specific problems
- file_system.hpp: File System Access
- subprocesses.hpp: Subprocess Handler
- tcp_sockets.hpp: TCP Internet classes
- udp_sockets.hpp: UDP Internet classes
- dynaload.hpp: Dynamic Library Loader class
- dprintf.hpp: Safe Printf-like String Formatting
- wildcard.hpp: Wildcard String Matching
- time.hpp: Time Manipulation Functions
- build.hpp: Program Build Reporting
- inf.hpp: Infinite Precision Integers
- debug.hpp: Debugging Utilities

The portability library can be used as a stand-alone library since it does not use any features of the rest of the collection.

## Subsystems Library

The subsystems library contains components to build up applications in a modular way. They provide commonly-used functionality. The subsystems provided are:

- Introduction to the subsystems library
- library_manager.hpp: Library Manager
- message_handler.hpp: Message Handler
- ini_manager.hpp: Ini File Manager
- cli_parser.hpp: Command Line Parser
- timer.hpp: CPU Timer

The subsystems library requires at least the containers and portability libraries to be installed. These are hard dependencies.

## Strings Library

The strings library provides a set of functions that can be used to build up string representations of data structures for printing or for diagnostic text dumps. They use similar concepts to the persistence library in that they form a kit of parts which can be assembled to print any data structure.

- Introduction to the strings library
- string_basic.hpp: String Formatting of Basic Types
- string_stl.hpp: String Formatting of STL Containers
- string_stlplus.hpp: String Formatting of STLplus Containers
- string_utilities.hpp: String Utilities

The strings library has soft dependencies on the containers and portability libraries. Without the containers library, the library provides string representations of all C and C++ types including the STL classes. With the containers library it also makes the STLplus classes in the containers library printable. With the portability library, it makes the STLplus infinite-precision integer printable.