Skip to content

Reference

This section contains reference documentation for the public API of T'Pau C++ Kernal. It is meant to be comprehensive and detailed, but may not be the best place to start for new users. It is intended to be used as a reference for specific classes and functions.

Warning

The API is still in development and may change in breaking ways.

The concepts and design decisions behind the API are explained in the Explanations section.

To get started, please refer to the Tutorials section. For practical instructions, see the How-To Guides section.

Base64Coder

Encode and decode Base64 data to strings or output streams.

CheckedWeakPointer

A weak pointer that throws an exception when it has expired.

Coder

Command

Base class for command line programs.

It only produces the output files if no errors occurred during processing.

Commandline

A command line parser.

It parses command line options and arguments according to the given options and arguments specification. It also provides usage and version information.

DiagnosticOutput

Exception

Base class for Kernal exceptions.

FileReader

Provides an interface for reading files, with support for caching and binary files.

FileSource

Represents a source of characters from a file, with support for lookahead and seeking.

FlagSet

A set of flags. The possible flags are defined by an enum type.

This is meant to be used with enum types that don't explicitly define the values of their members. Do not define the values as powers of two. Values must be between 0 and 63, inclusive.

HexCoder

Encode and decode hexadecimal data to strings or output streams.

Int

This class provides static methods for various integer utility functions.

Location

Represents a location within a file, including the file name, start position, and end position.

Line and column numbers are 1-based, and 0 indicates that it is not specified.

LocationException

Kernal exceptions with location.

SearchPath

Class representing a search path for files, consisting of a list of directories to search in.

Symbol

A Symbol represents a string in a way that allows copying and comparison in constant time.

Even though it uses the global symbol table and C++ does not guarantee the order of initialization of global variables, it is safe to use the Symbol constructor in global initializers.

SystemEnvironment

Access to system environment variables.

Since C++ does not provide a standard way to access environment variables, this class provides a platform-independent interface for getting, setting, and unsetting environment variables.

On Windows it uses GetEnvironmentVariable, SetEnvironmentVariable, since they are available in all build environments. However, variables changed this way won't reflect when queried using std::getenv.

On POSIX systems it uses getenv, setenv, and unsetenv.

UTF8

Utility functions for working with UTF-8 and Unicode code-points.

Util

This header file collects various utility functions.

Value

This class represents a value of various types.

All operations check for compatible types and integer overflow. Invalid operations throw an exception.

Supported types are boolean, signed and unsigned integers, floating point numbers, strings, binary data and void (has no value).