Automatic Dependency and LOC
List of dependencies between libraries and the number of lines of code (LOC) composing them gives an immediate complexity indication.
For this reason from this month I've started publishing:
- The reported lines of code (LOC) for each library
- The dependencies between libraries
An automatic python scripts now updates both inside each library documentation page and also to Readmes and elsewhere.
This has been the input to start attacking and removing un-needed inter-dependencies between libraries.
This has in turn freed many libraries from dynamic allocation!
Detailed list of commits:
- Documentation: Add lines of code count to Libraries.md
- Documentation: Report dependencies between libraries
- Documentation: Report lines of code count of each library
- Documentation: Update LOC also for README.md
Foundation cleanup
The Foundation
library received several updates in order to make it as minimal as possible.
StringViewData
was renamed toStringSpan
for better clarity.- A new
StringPath
class was introduced to handle file system paths with maximum length constraints and UTF-16 conversion. - Rarely used methods in
Span<T>
were moved to where they are actually used, and some unusedTypeTraits
were removed. - Backtrace printing for
Assert
was implemented on Windows. - Some classes have been moved elsewhere (like
Limits.h
).
All of these building blocks have been necessary to allow removal of several inter-dependencies between libraries in the project.
Dynamic allocation status: No allocation
Detailed list of commits:
- Foundation: Add StringPath holding the maximum length of a file system path
- Foundation: Add write and append null terminated to StringSpan
- Foundation: Implement Assert backtrace printing for Windows
- Foundation: Move IntrusiveDoubleLinkedList to Async
- Foundation: Move Limits.h to Testing
- Foundation: Move rarely used Span
methods where they're actually used - Foundation: Refactor StringPath functionality in a reusable StringNativeFixed
- Foundation: Remove some rarely used TypeTraits
- Foundation: Remove some useless macros
- Foundation: Rename StringViewData to StringSpan
- Foundation: Use Result in StringSpan to communicate error reason
Async dependencies
Async
is an advanced multi-platform async IO library with a feature set that is progressively expanding.
The biggest library of the project has now no more dependency on Process
library.
Combining this with all the other dependency cleanups of this month makes the library set of transitive dependencies much cleaner.
Previously the SC::Async
Library was depending on almost the entire rest of Sane C++ Libraries!
Now the entire list of dependencies for Async
is File
, FileSystem
, Foundation
, Socket
, Threading
, Time
.
Dynamic allocation status: No allocation
Detailed list of commits:
FileSystemWatcher Dependencies
FileSystemWatcher
has probably been the hardest dependency cleanup to finish.
In addition to removing dependencies from Strings
and Memory
libraries, it has been necessary to remove dependency from the Async
library too.
The reason is that FileSystemWatcher
supports both a thread based backend or an event loop based one.
Now the role of integrating FileSystemWatcher
with Async
has been isolated in the FileSystemWatcherAsync
library, through some minimal runtime virtual interface usage.
Dynamic allocation status: No allocation
Detailed list of commits:
- FileSystemWatcher: Reduce manual string handling with StringPath
- FileSystemWatcher: Remove dependency from Async and File libraries
- FileSystemWatcher: Remove dependency from Memory library
- FileSystemWatcher: Use StringPath where appropriate to simplify code
FileSystem Dependencies
The FileSystem
library underwent significant refactoring to simplify its code and reduce dependencies:
- Platform-specific implementations were merged into
FileSystemOperations
. - Methods like
makeDirectoryRecursive
were added, whileremoveEmptyDirectoryRecursive
was removed. - Dependencies on
Containers
,Strings
, andMemory
libraries were eliminated, making the library more lightweight and focused.
Library now only depends on Foundation
and Time
libraries.
Dynamic allocation status: No allocation
Detailed list of commits:
- FileSystem: Get rid of removeEmptyDirectoryRecursive
- FileSystem: Implement FileSystemOperations makeDirectoryRecursive
- FileSystem: Merge platform specific implementation in FileSystemOperations
- FileSystem: Move FileSystemOperations to FileSystem::Operations
- FileSystem: Re-implement FileSystemDirectories methods in FileSystemOperations
- FileSystem: Remove dependency from Containers library
- FileSystem: Remove dependency from String and Memory libraries
FileSystemIterator dependencies
FileSystemIterator
has been already cleaned up during path month's effort.
This month however the extremely error prone manual string handling has been reduced through the use of the new StringPath class
Library now only depends on Foundation
library.
Dynamic allocation status: No allocation
Detailed list of commits:
File dependencies
File
has also seen removal of dependencies from Memory
and Strings
, by using StringPath
for simplifying string handling.
Library now only depends on Foundation
library.
Dynamic allocation status: No allocation
Detailed list of commits:
- File: Remove dependency from Memory and Strings Libraries
- File: Rename FileDescriptor.cpp to just File.cpp
- File: Use StringPath where appropriate to simplify code
Process dependencies
The Process
library has seen also dependency from Strings
and Memory
library removed, through some lightweight runtime abstraction (IGrowableBuffer
).
This interface abstracts read/write operation to/from Strings
and Buffers
.
Library now only depends on File
and Foundation
libraries.
Dynamic allocation status: No allocation
Detailed list of commits:
- Process: Merge ProcessDescriptor.h to Process.h
- Process: Remove dependency from Strings library
- Process: Use IGrowableBuffer when outputting to String / Buffer
Socket dependencies
The Socket
libraries has been streamlined by removing dependencies on Strings
, File
, Threading
and Time
.
Library now only depends on Foundation
.
Dynamic allocation status: No allocation
Detailed list of commits:
- Socket: Remove dependency from File library
- Socket: Merge SocketDescriptor.h to Socket.h
- Socket: Remove dependency from Threading library
- Socket: Remove dependency from Time library
Strings improvements
The Strings
library saw several improvements:
StringNative
was renamed toSmallStringNative
.Path
functionality was moved from theFileSystem
library toStrings
.StringConverter
was updated to acceptStringSpan
.
Dynamic allocation status: Allocates dynamic memory
Detailed list of commits:
- Strings: Change StringConverter to accept StringSpan
- Strings: Fix clang warning about GrowableBuffer destructor marked as final
- Strings: Move Path from FileSystem to Strings library
- Strings: Rename StringNative to SmallStringNative
Other improvements
- The CI pipeline was updated to replace Windows Server 2019 with Windows Server 2025.
- Code was cleaned up to remove warnings reported by
clangd
- Debug Visualizers have been fixed
Detailed list of commits: