Skip to content

BonnyAD9/Bny.General

Repository files navigation

Bny.General

C# library with generally useful stuff.

In this repository

  • Bny.General: the library
  • Bny.General.Tester: unit tests
  • Documentation: documentation generated by Doxygen

Library features

Bny.General.Memory

Things that work with memory.

Features:

  • ConstPtr<T> pointer to constant memory, simillar to ReadOnlySpan but has pointer arithmetic and other coll stuff
  • Ptr<T> pointer to memory, simillar to Span<T> but has pointer arighmetic and other cool stuff
  • ReadOnlySpanWrapper<T> wrapper for ReadOnlySpan<T> that can be casted to object
  • SpanWrapper<T> wrapper for Span<T> that can be casted to object
  • ConstPtrOrStream 'interface' for either ConstPtr<byte> or stream
  • PtrOrStream 'interface' for either Ptr<byte> or stream

Bny.General.Errorhandling

Features that help with error propagation.

Features:

  • Result class that can hold boolean value (success, failure) and message (usually in case of failure) and can throw exception (with that message)
  • ResultEx<Ex> derives from Result, you can also specify the type of exception
  • Result<T> derives from Result, you can specify a return value (usually in case of success)
  • Result<T, Ex> derives from Result<T>, you can also specfy the type of exception

How to get it

This library is available as a NuGet package.

Links