Skip to content

candoumbe/Candoumbe.Types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Types

GitHub Workflow Status (develop) GitHub Workflow Status (nightly) GitHub Workflow Status (main) codecov GitHub raw issues Nuget Nuget Nuget Nuget Mutation testing badge Mutation testing badge Mutation testing badge

Various custom types that can be useful when doing development.

Disclaimer

This project adheres to Semantic Versioning.

Major version zero (0.y.z) is for initial development. Anything MAY change at any time.

The public API SHOULD NOT be considered stable.

How it all started

This project was born out of frustration encountered while developing a matching algorithm in a professional context. The goal of that project was to enable the effective matching of one or more temporary workers based on :

  • the assignment dates
  • the declared availability of collaborators.
  • their qualification ...

With the team back then, it took several weeks to get this "planning matcher" to work properly and, at the time, I was not very happy with the result (specifically with the planning matching part of the algorithm).

That's how I started working on types from Candoumbe.Types.Calendar namespace.

Features

All following features depend on Candoumbe.Types.Core package.

Calendar

Calendar namespace contains various types related to calendar operations, such as:

  • DateTimeRange: a datetime range represents a interval between two DateTimes
  • DateOnlyRange: an interval between two DateOnlys
  • TimeOnlyRange: an interval between two TimeOnlys

Numerics

Numerics namespace contains various types useful when you want to work with very specific numeric values such as:

  • NonNegativeInteger: a type that can only hold non-negative integers
  • PositiveInteger: a type that can only hold integer values greater than zero.

Strings

Strings namespace contains various string-like data

StringSegmentLinkedList

A StringSegmentLinkedList is a special IEnumerable<char> implementation that can be used to perform highly performant "replace"

classDiagram
    direction RL

    namespace Strings {
        class StringSegmentNode {
            + ReadonlyMemory~char~ Value
        }

        class StringSegmentLinkedList {
            - StringSegmentNode head
            - StringSegmentNode tail
            + Append(ReadOnlySpan~char~) StringSegmentLinkedList
            + Append(StringSegmentLinkedList) StringSegmentLinkedList
            + Contains(ReadOnlySpan~char~) bool
            + Contains(Func~char,bool~) bool
            + Replace(Func~char,bool~ predicate, ReadOnlySpan~char~ newValue) StringSegmentLinkedList
            + Replace(Func~char,bool~ predicate, IReadOnlyDictionaryOfChar~ReadOnlyMemory~char~~ substitutions) StringSegmentLinkedList
            + Replace(char oldValue, char newValue) StringSegmentLinkedList
            + Replace(char oldValue, ReadOnlySpan<char> newValue) StringSegmentLinkedList
            + Replace(ReadOnlySpan~char~ oldValue, ReadOnlySpan<char> newValue) StringSegmentLinkedList
        }
    }

    IEnumerableOfReadOnlyMemory~char~ <|-- StringSegmentLinkedList
    StringSegmentLinkedList "1" --> "1" StringSegmentNode: head
    StringSegmentLinkedList "0" .. "1" StringSegmentNode: tail
Loading

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the project. License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Custom types that can be usefull when doing development.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages