Thanks to visit codestin.com
Credit goes to github.com

Skip to content

shaozhixue/SaneCppLibraries

 
 

Repository files navigation

Windows Linux+macOS Coverage

Sane C++ Libraries

YouTube X Discord GitHub Repo stars

Sane C++ Libraries is a set of C++ platform abstraction libraries for macOS, Windows and Linux.

Sane Cpp

Principles:

✅ Fast compile times
✅ Bloat free
✅ Simple and readable code
✅ Easy to integrate
⛔️ No C++ Standard Library / Exceptions / RTTI
⛔️ No third party build dependencies (prefer OS API)

Visit the documentation website for more information.

Take a look also at DeepWiki/SaneCppLibraries for an AI-guided walkthrough of the project!

Libraries

Each library only depends on the smallest possible subset of the others libraries (see Dependencies).

Library Description LOC
Algorithms 🟥 Placeholder library where templated algorithms will be placed 102
Async 🟨 Async I/O (files, sockets, timers, processes, fs events, threads) 5661
Async Streams 🟥 Concurrently read, write and transform byte streams 2013
Build 🟨 Minimal build system where builds are described in C++ 4094
Containers 🟨 Generic containers (SC::Vector, SC::SmallVector, SC::Array etc.) 801
File 🟩 Synchronous Disk File I/O 700
File System 🟩 File System operations (like copy / delete) for files / directories 1323
File System Iterator 🟩 Enumerates files and directories inside a given path 417
File System Watcher 🟩 Notifications {add, remove, rename, modified} for files / directories 1319
File System Watcher Async 🟩 Async backend for File System Watcher 113
Foundation 🟩 Primitive types, asserts, compiler macros, Function, Span, Result 1215
Hashing 🟩 Compute MD5, SHA1 or SHA256 hashes for a stream of bytes 359
Http 🟥 HTTP parser, client and server 1299
Memory 🟩 Custom allocators, Virtual Memory, Buffer, Segment 1257
Plugin 🟨 Minimal dependency based plugin system with hot-reload 1464
Process 🟩 Create child processes and redirect their input / output 1318
Reflection 🟩 Describe C++ types at compile time for serialization 700
Serialization Binary 🟨 Serialize to and from a binary format using Reflection 594
Serialization Text 🟨 Serialize to / from text formats (JSON) using Reflection 661
Socket 🟨 Synchronous socket networking and DNS lookup 889
Strings 🟩 String formatting / conversion / manipulation (UTF8 / UTF16) 3387
Testing 🟨 Simple testing framework used by all of the other libraries 343
Threading 🟥 Atomic, thread, thread pool, mutex, condition variable 895
Time 🟨 Time handling (relative, absolute, high resolution) 349

Each library is color-coded to signal its status:
🟥 Draft (incomplete, WIP, works on basic case)
🟨 MVP (minimum set of features have been implemented)
🟩 Usable (a reasonable set of useful features has been implemented)
🟦 Complete (all planned features have been implemented)

C Bindings

Some Libraries have C bindings

Binding Description
sc_hashing Bindings for the Hashing Library

Building

Libraries can be used as is, adding a single file to your project and without needing any build system.
See Building (user) to just use the library

Shortly:

  • Add SC.cpp to your build system of choice
  • Define SC_COMPILER_ENABLE_STD_CPP=1 if you plan to use the Standard C++ library
  • Include any public header (Libraries/[Library]/*.h)

Windows

  • If using MSVC required libraries are already implicitly linked through #pragma comment(lib, ...)

macOS / iOS

  • Link CoreFoundation.framework
  • Link CoreServices.framework

Linux

  • Link libdl (-ldl)
  • Link libpthread (-lpthread)

Examples

SCExample showcases integration of Sane C++ Libraries together with Dear ImGui and sokol libraries (see Examples page).

macOS

SCExample_04.mp4

iOS

SCExampleIOS_01.mp4

Tests

Tests are built with the self-hosted SC::Build project generator, describing the builds in C++.
Check Building (contributor) to run the tests.

Getting in touch

Alternatively I am also reading the following discords too:

Contributing

Please take some time to read the Principles and Coding Style.

After that you can read the CONTRIBUTING.md guide.

License

Sane C++ Libraries are licensed under the MIT License, see LICENSE.txt for more information.

Videos

On this YouTube Channel there are some videos showing bits of the development process.

Blog posts

On Sane Coding Blog there is a series of posts about this project.

Relevant yearly posts:

About

Sane C++ Libraries

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.5%
  • Python 1.2%
  • C 0.7%
  • Makefile 0.4%
  • Batchfile 0.1%
  • Shell 0.1%