Project Structure

Directory layout, important files, and what each folder is responsible for.

Top-Level Layout

sharp-runtime/
├── CMakeLists.txt          # Main CMake build configuration
├── README.md               # Project overview
├── CLAUDE.md               # Developer rules and architecture invariants
├── DOTNET_PORTING_PLAN.md  # Porting status of all .NET types
├── NEXT.md                 # Session handoff / status document
├── TODO.md                 # Known TODOs
├── Doxyfile                # Doxygen configuration
├── LICENSE                 # MIT license
├── include/                # ← All public headers
├── src/                    # ← Implementation (.cpp files)
├── tests/                  # ← Test files (GoogleTest)
├── vendor/                 # ← Vendored dependencies
└── build/                  # ← Generated build artifacts (not committed)

include/ — Public Headers

All public API headers live here. This directory is added to include paths via target_include_directories(SHARP_RUNTIME PUBLIC …).

include/
├── SharpRuntime/
│   ├── SharpRuntimeHelper.hpp  # Primitive type aliases (intcs, bytecs, etc.)
│   ├── Prop.hpp                # Property macros (DDATA, DGETTER, etc.)
│   ├── Storage/
│   │   └── StoragePaths.hpp    # Isolated storage path utilities
│   └── Experimental/
│       ├── Property.hpp        # Experimental property wrapper (not used in main code)
│       └── ReadonlyProperty.hpp
└── System/
    ├── Object.hpp              # Base class for all System types
    ├── Exception.hpp           # Base exception class
    ├── String.hpp              # Static string utilities
    ├── Array.hpp               # Static array helpers
    ├── Math.hpp                # Math static class
    ├── Convert.hpp             # Type conversion utilities
    ├── DateTime.hpp            # Date and time
    ├── TimeSpan.hpp            # Time interval
    ├── Guid.hpp                # RFC 4122 GUID
    ├── Random.hpp              # Pseudo-random number generator
    ├── Nullable.hpp            # Nullable<T> (wraps std::optional)
    ├── Action.hpp              # Delegate types (Action, ActionT, ActionT2...)
    ├── Func.hpp                # Function delegate types
    ├── EventArgs.hpp           # Base event arguments class
    ├── EventHandler.hpp        # EventHandler<T> template
    ├── Console.hpp             # Console I/O (header-only)
    ├── Environment.hpp         # Environment utilities (header-only)
    ├── Collections/
    │   ├── Generic/            # List<T>, Dictionary<K,V>, HashSet<T>, etc.
    │   ├── Concurrent/         # ConcurrentDictionary, ConcurrentQueue, etc.
    │   ├── Immutable/          # ImmutableArray, ImmutableList, etc.
    │   └── ObjectModel/        # Collection<T>, ObservableCollection<T>, etc.
    ├── IO/
    │   ├── Stream.hpp          # Abstract stream base
    │   ├── FileStream.hpp      # File-backed stream
    │   ├── MemoryStream.hpp    # In-memory stream
    │   ├── File.hpp            # Static file utilities
    │   ├── Directory.hpp       # Static directory utilities
    │   ├── Path.hpp            # Path manipulation
    │   ├── BinaryReader.hpp    # Binary data reader
    │   ├── BinaryWriter.hpp    # Binary data writer
    │   ├── Compression/        # GZipStream, DeflateStream, ZipArchive
    │   ├── Hashing/            # XxHash32, XxHash64, Crc32
    │   └── IsolatedStorage/    # IsolatedStorageFile, IsolatedStorageFileStream
    ├── Text/
    │   ├── StringBuilder.hpp   # Mutable string buffer
    │   ├── Encoding.hpp        # Abstract encoding base
    │   ├── UTF8Encoding.hpp    # UTF-8 encoding
    │   ├── ASCIIEncoding.hpp   # ASCII encoding
    │   ├── Json/               # JsonDocument, JsonSerializer (nlohmann)
    │   └── RegularExpressions/ # Regex, Match, MatchCollection
    ├── Xml/
    │   ├── XmlReader.hpp       # XML reading cursor (tinyxml2)
    │   ├── XmlWriter.hpp       # XML writing (tinyxml2)
    │   └── Linq/               # XDocument, XElement, XAttribute
    ├── Threading/
    │   ├── Thread.hpp          # Managed thread
    │   ├── Mutex.hpp           # Mutual exclusion
    │   ├── Monitor.hpp         # Monitor synchronization
    │   ├── CancellationToken.hpp
    │   ├── Timer.hpp           # Recurring timer
    │   ├── Tasks/              # Task<T>, ValueTask, Parallel
    │   └── ...
    ├── Numerics/
    │   ├── Vector2.hpp / Vector3.hpp / Vector4.hpp
    │   ├── Matrix3x2.hpp / Matrix4x4.hpp
    │   ├── Quaternion.hpp / Plane.hpp
    │   ├── BigInteger.hpp
    │   └── Colors/             # Argb, Rgba, Colors
    ├── Globalization/
    │   ├── CultureInfo.hpp
    │   ├── Calendar.hpp (and many calendar subclasses)
    │   └── ...
    ├── Diagnostics/
    │   ├── Debug.hpp
    │   ├── Stopwatch.hpp
    │   └── ...
    └── Net/
        └── Sockets/            # TcpClient, UdpClient, NetworkStream

src/ — Implementation Files

Each .cpp file in src/ corresponds to a header in include/. Simple, header-only types do not have a corresponding .cpp.

src/
├── SharpRuntime/
│   └── Storage/
│       └── StoragePaths.cpp    # Platform-specific storage paths
└── System/
    ├── Object.cpp
    ├── Exception.cpp
    ├── String.cpp
    ├── Math.cpp
    ├── DateTime.cpp
    ├── Guid.cpp
    ├── Convert.cpp
    ├── IO/
    │   ├── Stream.cpp
    │   ├── FileStream.cpp
    │   ├── MemoryStream.cpp
    │   ├── File.cpp
    │   ├── Directory.cpp
    │   ├── BinaryReader.cpp / BinaryWriter.cpp
    │   ├── Compression/        # DeflateStream.cpp, GZipStream.cpp, ZipArchive.cpp
    │   ├── Hashing/            # XxHash32.cpp, XxHash64.cpp
    │   └── IsolatedStorage/    # IsolatedStorageFile.cpp, etc.
    ├── Text/
    │   ├── StringBuilder.cpp
    │   ├── Encoding.cpp
    │   └── ...
    ├── Threading/
    │   └── CancellationToken.cpp
    ├── Numerics/
    │   └── BigInteger.cpp
    ├── Globalization/
    │   ├── HebrewCalendar.cpp
    │   ├── HijriCalendar.cpp
    │   └── ...
    └── Net/
        └── Sockets/            # TcpClient.cpp, UdpClient.cpp, NetworkStream.cpp

tests/ — Test Files

74 test files organized by namespace, mirroring include/System/:

tests/
├── CalendarTests.cpp
├── CompressionTests.cpp
├── DateTimePropertiesTests.cpp
└── System/
    ├── ArrayTests.cpp
    ├── BitConverterTests.cpp
    ├── Collections/
    │   ├── Generic/
    │   │   ├── CollectionsTests.cpp
    │   │   ├── LinkedListSortedSetTests.cpp
    │   │   └── QueueStackTests.cpp
    │   ├── ImmutableCollectionTests.cpp
    │   ├── ConcurrentTests.cpp
    │   └── ...
    ├── DateTimeTests.cpp
    ├── StringTests.cpp
    └── Threading/
        └── ...

vendor/ — Third-Party Code

vendor/
├── googletest/     # GoogleTest (git submodule) — test framework
├── nlohmann/
│   └── json.hpp    # nlohmann/json v3.10.4 — System::Text::Json
├── tinyxml2/       # tinyxml2 — System::Xml::XmlReader/XmlWriter
└── miniz/          # miniz — System::IO::Compression::ZipArchive

Important Root Files

FilePurpose
CMakeLists.txtMain CMake build; defines all targets and options
CLAUDE.mdNon-negotiable project rules, architecture invariants, platform policy
DOTNET_PORTING_PLAN.mdFull status table of all .NET types (Done/Port/Stub/Ignore)
NEXT.mdSession handoff document — current status, recent changes, next steps
TODO.mdShort list of known remaining work (Net subsystem)
DoxyfileDoxygen configuration for auto-generated API docs
README.mdPublic-facing project overview and quick start
LICENSEMIT license with .NET Foundation attribution

Generated / Not-Committed

DirectoryNotes
build/CMake build artifacts. Generated, not committed.
.cna_isolated_storage/Runtime isolated storage data created during test runs. Not committed.