Update README.md
This commit is contained in:
parent
f4a2fee0d7
commit
cbaa413cd0
1 changed files with 20 additions and 7 deletions
27
README.md
27
README.md
|
@ -16,7 +16,6 @@ a Array
|
||||||
|
|
||||||
## Index
|
## Index
|
||||||
- How to install
|
- How to install
|
||||||
- Changelog
|
|
||||||
- The Bofa notation
|
- The Bofa notation
|
||||||
- Parser notes
|
- Parser notes
|
||||||
- Bofa parser API usage
|
- Bofa parser API usage
|
||||||
|
@ -35,12 +34,6 @@ a Array
|
||||||
- Add the Bofa namespace to the files you want to use Bofa with
|
- Add the Bofa namespace to the files you want to use Bofa with
|
||||||
- Use Bofa
|
- Use Bofa
|
||||||
|
|
||||||
## Changelog
|
|
||||||
- Version 1.0.0
|
|
||||||
- Initial Version
|
|
||||||
- Fast parsing
|
|
||||||
- Add automated serialization generation
|
|
||||||
|
|
||||||
## The Bofa notation
|
## The Bofa notation
|
||||||
The notation itself is pretty simple.
|
The notation itself is pretty simple.
|
||||||
Every line contains one Bofa "Entry", but empty lines and comments are also allowed.
|
Every line contains one Bofa "Entry", but empty lines and comments are also allowed.
|
||||||
|
@ -134,6 +127,26 @@ class ExampleClass
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Bofa serialization API usage
|
||||||
|
Serialization can be used to map types from and to Bofa with only minimal work required.
|
||||||
|
The interface IBofaParseable indicates wether a specific type can be parsed.
|
||||||
|
You can manually add it to your class and its also available on some corelib types by default.
|
||||||
|
There is also an attribute you can use to make Bofa attempt to generate the interface at compile time.
|
||||||
|
```cs
|
||||||
|
[BofaSerialize(Strict = false)] //false by default. If set to true it will fail when it cant find/parse a field
|
||||||
|
class Serialization
|
||||||
|
{
|
||||||
|
//It attempts to parse all public fields
|
||||||
|
//[BofaInclue(Name = "FieldName")]
|
||||||
|
//Can be used to include private fields and to rename fields with whatever name you want
|
||||||
|
|
||||||
|
public int anInteger = 1;
|
||||||
|
public String aString = new .("Value") ~ delete _;
|
||||||
|
public List<String> listOfStrings = new .() ~ DeleteContainerAndItems!(_); //As long as the T can be parsed it will also parse lists and dictionaries
|
||||||
|
[BofaRequired] public int anotherOne = 0; //Parsing will fail if this field isnt present, since its marked as required
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Potential improvements
|
## Potential improvements
|
||||||
- There is still alot of speed left on the table
|
- There is still alot of speed left on the table
|
||||||
- Reduce the amount of allocations
|
- Reduce the amount of allocations
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue