# cppfastio/fast_io architecture

> Architecture diagram of the GitHub repository cppfastio/fast_io, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cppfastio/fast_io
- Repository: https://github.com/cppfastio/fast_io

## Overview

fast_io is a header-only C++ I/O library intended to provide faster alternatives to iostream and stdio. The main user workflow is to select an I/O device, then print or scan values through the library’s generic operations, with hosted file and native-handle facilities available as sources and destinations. Supporting branches include character conversion, containers, filesystem and memory mapping, cryptography/TLS, and locale data. The README documents several of these capabilities, while source excerpts show selected TLS, container, and locale internals; links for unsampled subsystems are therefore limited to documented relationships.

Main entry points: [`include/fast_io_crypto/tls/client.h`](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/client.h) (TLS Client), [`include/fast_io_dsal/impl/common.h`](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/common.h) (Containers), [`include/fast_io_legacy_impl/io.h`](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_legacy_impl/io.h) (Print and Scan), [`include/fast_io_core_impl/operations`](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_core_impl/operations) (I/O Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["I/O API"]
  node_api["Print and Scan<br/>[io.h]"]
  node_concepts["Device Concepts<br/>[fast_io_concept.h]"]
  node_operations["I/O Operations"]
  node_core["Core Runtime<br/>[fast_io_core.h]"]
end

subgraph group_devices["Devices and Data"]
  node_native["Native I/O"]
  node_files["File I/O<br/>[io_file.h]"]
  node_filesystem["Filesystem"]
  node_mmap["Memory Mapping"]
  node_containers["Containers<br/>[common.h]"]
  node_vector["Vector<br/>[vector.h]"]
  node_deque["Deque<br/>[deque.h]"]
  node_strings["Strings<br/>[string.h]"]
end

subgraph group_text["Text and Locale"]
  node_codecvt["Character Conversion<br/>[impl.h]"]
  node_serialization["Binary Serialization<br/>[lebe.h]"]
  node_locale["Locale Formatting<br/>[lc_print.h]"]
  node_locale_blob["Locale Blob Tools<br/>[lcblob.h]"]
  node_binfmt["Blob Compiler<br/>[compile.h]"]
end

subgraph group_security["Crypto and TLS"]
  node_crypto["Crypto Primitives<br/>[fast_io_crypto.h]"]
  node_tls_client["TLS Client<br/>[client.h]"]
  node_tls_server["TLS Server<br/>[server.h]"]
  node_tls_async["TLS Async<br/>[async.h]"]
  node_schannel["Schannel Backend<br/>[schannel.h]"]
end

subgraph group_extensions["Hosted Extensions"]
  node_whitehole["Random Source<br/>[white_hole.h]"]
  node_drivers["Integration Drivers"]
end

node_user(("Application"))

node_user -->|"calls print or scan"| node_api
node_api -->|"dispatches operations"| node_operations
node_operations -.->|"uses device concepts"| node_concepts
node_operations -.->|"uses core facilities"| node_core
node_user -->|"opens files"| node_files
node_user -->|"selects native device"| node_native
node_user -->|"loads mapped data"| node_mmap
node_files -.->|"works with paths"| node_filesystem
node_containers -.->|"provides vector"| node_vector
node_containers -.->|"provides deque"| node_deque
node_containers -.->|"provides strings"| node_strings
node_api -->|"supports Unicode I/O"| node_codecvt
node_user -->|"serializes data"| node_serialization
node_user -->|"formats with locale"| node_locale
node_binfmt -->|"builds locale blobs"| node_locale_blob
node_locale_blob -->|"uses string buffers"| node_strings
node_user -->|"uses hash algorithms"| node_crypto
node_user -.->|"initiates TLS client"| node_tls_client
node_user -.->|"runs TLS server"| node_tls_server
node_tls_client -->|"includes async support"| node_tls_async
node_tls_client -->|"includes backend"| node_schannel
node_tls_server -.->|"shares TLS protocol"| node_tls_client
node_user -.->|"requests randomness"| node_whitehole
node_user -->|"uses integrations"| node_drivers

click node_api "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_legacy_impl/io.h"
click node_concepts "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_concept.h"
click node_operations "https://github.com/cppfastio/fast_io/tree/main/include/fast_io_core_impl/operations"
click node_core "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_core.h"
click node_native "https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted"
click node_files "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_hosted/io_file.h"
click node_filesystem "https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted/filesystem"
click node_mmap "https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted/mmap"
click node_containers "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/common.h"
click node_vector "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/vector.h"
click node_deque "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/deque.h"
click node_strings "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/string.h"
click node_codecvt "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_core_impl/codecvt/impl.h"
click node_serialization "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_freestanding_impl/serializations/lebe.h"
click node_locale "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_i18n/lc_print.h"
click node_locale_blob "https://github.com/cppfastio/fast_io/blob/main/src/binfmt/lcblob.h"
click node_binfmt "https://github.com/cppfastio/fast_io/blob/main/src/binfmt/compile.h"
click node_crypto "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto.h"
click node_tls_client "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/client.h"
click node_tls_server "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/server.h"
click node_tls_async "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/async.h"
click node_schannel "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/schannel.h"
click node_whitehole "https://github.com/cppfastio/fast_io/blob/main/include/fast_io_hosted/white_hole/white_hole.h"
click node_drivers "https://github.com/cppfastio/fast_io/tree/main/include/fast_io_driver"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_concepts,node_operations,node_core toneBlue
class node_native,node_files,node_filesystem,node_mmap,node_containers,node_vector,node_deque,node_strings toneAmber
class node_codecvt,node_serialization,node_locale,node_locale_blob,node_binfmt toneMint
class node_crypto,node_tls_client,node_tls_server,node_tls_async,node_schannel toneRose
class node_whitehole,node_drivers,node_user toneIndigo
```

## Components

### I/O API

- [Print and Scan](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_legacy_impl/io.h): `include/fast_io_legacy_impl/io.h`
- [Device Concepts](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_concept.h): `include/fast_io_concept.h`
- [I/O Operations](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_core_impl/operations): `include/fast_io_core_impl/operations`
- [Core Runtime](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_core.h): `include/fast_io_core.h`

### Devices and Data

- [Native I/O](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted): `include/fast_io_hosted`
- [File I/O](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_hosted/io_file.h): `include/fast_io_hosted/io_file.h`
- [Filesystem](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted/filesystem): `include/fast_io_hosted/filesystem`
- [Memory Mapping](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_hosted/mmap): `include/fast_io_hosted/mmap`
- [Containers](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/common.h): `include/fast_io_dsal/impl/common.h`
- [Vector](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/vector.h): `include/fast_io_dsal/impl/vector.h`
- [Deque](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/deque.h): `include/fast_io_dsal/impl/deque.h`
- [Strings](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_dsal/impl/string.h): `include/fast_io_dsal/impl/string.h`

### Text and Locale

- [Character Conversion](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_core_impl/codecvt/impl.h): `include/fast_io_core_impl/codecvt/impl.h`
- [Binary Serialization](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_freestanding_impl/serializations/lebe.h): `include/fast_io_freestanding_impl/serializations/lebe.h`
- [Locale Formatting](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_i18n/lc_print.h): `include/fast_io_i18n/lc_print.h`
- [Locale Blob Tools](https://github.com/cppfastio/fast_io/blob/main/src/binfmt/lcblob.h): `src/binfmt/lcblob.h`
- [Blob Compiler](https://github.com/cppfastio/fast_io/blob/main/src/binfmt/compile.h): `src/binfmt/compile.h`

### Crypto and TLS

- [Crypto Primitives](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto.h): `include/fast_io_crypto.h`
- [TLS Client](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/client.h): `include/fast_io_crypto/tls/client.h`
- [TLS Server](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/server.h): `include/fast_io_crypto/tls/server.h`
- [TLS Async](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/async.h): `include/fast_io_crypto/tls/async.h`
- [Schannel Backend](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_crypto/tls/schannel.h): `include/fast_io_crypto/tls/schannel.h`

### Hosted Extensions

- [Random Source](https://github.com/cppfastio/fast_io/blob/main/include/fast_io_hosted/white_hole/white_hole.h): `include/fast_io_hosted/white_hole/white_hole.h`
- [Integration Drivers](https://github.com/cppfastio/fast_io/tree/main/include/fast_io_driver): `include/fast_io_driver`

### Other components

- **Application**

## Connections

- Application → Print and Scan: calls print or scan
- Print and Scan → I/O Operations: dispatches operations (evidence: `include/fast_io_legacy_impl/io.h`)
- I/O Operations → Device Concepts: uses device concepts
- I/O Operations → Core Runtime: uses core facilities
- Application → File I/O: opens files
- Application → Native I/O: selects native device
- Application → Memory Mapping: loads mapped data
- File I/O → Filesystem: works with paths
- Containers → Vector: provides vector
- Containers → Deque: provides deque
- Containers → Strings: provides strings
- Print and Scan → Character Conversion: supports Unicode I/O
- Application → Binary Serialization: serializes data
- Application → Locale Formatting: formats with locale
- Blob Compiler → Locale Blob Tools: builds locale blobs (evidence: `src/binfmt/lcblob.h`)
- Locale Blob Tools → Strings: uses string buffers (evidence: `src/binfmt/lcblob.h`)
- Application → Crypto Primitives: uses hash algorithms
- Application → TLS Client: initiates TLS client
- Application → TLS Server: runs TLS server
- TLS Client → TLS Async: includes async support (evidence: `include/fast_io_crypto/tls/client_impl.h`)
- TLS Client → Schannel Backend: includes backend (evidence: `include/fast_io_crypto/tls/client_impl.h`)
- TLS Server → TLS Client: shares TLS protocol
- Application → Random Source: requests randomness
- Application → Integration Drivers: uses integrations
