Skip to content

Commit

Permalink
Added more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Apr 4, 2022
1 parent aaa6971 commit ddb2577
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/site/api/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Api Documentation
Here you will find an overview over all exposed objects.
Here you will find an overview over all exposed objects and their documentation.
1 change: 0 additions & 1 deletion docs/site/articles/intro.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/site/articles/known_limitations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Known Limitations
The base of the `ValueStringBuilder` is a `ref struct`. With that there are certain limitations, which might make it not a good fit for your needs.
* `ref struct`s can only live on the **stack** and therefore can not be a field for a **class** or a non **ref struct**.
* Therefore they can't be boxed to `ValueType` or `Object`.
* Can't be captured ny a lambda expression (aka closure).
* Can't be used in `async` methods.
* Can't be used in methods which use the `yield` keyword

If not off this applies to your use case, you are good to go. Using `ref struct` is a trade for performance and less allocations in contrast to its use cases.
4 changes: 2 additions & 2 deletions docs/site/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- name: Introduction
href: intro.md
- name: Known limitations
href: known_limitations.md
26 changes: 22 additions & 4 deletions docs/site/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# This is the **HOMEPAGE**.
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
## Quick Start Notes:
1. Add images to the *images* folder if the file is referencing an image.
[![.NET](https://github.com/linkdotnet/StringBuilder/actions/workflows/dotnet.yml/badge.svg)](https://github.com/linkdotnet/StringBuilder/actions/workflows/dotnet.yml)

# ValueStringBuilder: A fast and low allocation StringBuilder for .NET

**ValueStringBuilder** aims to be as fast as possible with a minimal amount of allocation memory. This documentation will show case you how to use the `ValueStringBuilder` as well as what are some limitations coming with it. If you have questions or feature requests just head over to the [GitHub](https://github.com/linkdotnet/StringBuilder) repository and file and issue.

## Example
The API is leaning towards the normal `StringBuilder` which is part of the .net framework itself. The main key difference is, that the `ValueStringBuilder` does **not** use the fluent notation of its "big brother".

```csharp
var stringBuilder = new ValueStringBuilder();
stringBuilder.AppendLine("Hello");
stringBuilder.Append("World");

Console.Write(stringBuilder.ToString());
```

This will print
```
Hello
World
```

0 comments on commit ddb2577

Please sign in to comment.