Update to 1.1.0 #5
1 changed files with 20 additions and 7 deletions
27
README.md
27
README.md
|
@ -16,7 +16,6 @@ a Array
|
|||
|
||||
## Index
|
||||
- How to install
|
||||
- Changelog
|
||||
- The Bofa notation
|
||||
- Parser notes
|
||||
- Bofa parser API usage
|
||||
|
@ -35,12 +34,6 @@ a Array
|
|||
- Add the Bofa namespace to the files you want to use Bofa with
|
||||
- Use Bofa
|
||||
|
||||
## Changelog
|
||||
- Version 1.0.0
|
||||
- Initial Version
|
||||
- Fast parsing
|
||||
- Add automated serialization generation
|
||||
|
||||
## The Bofa notation
|
||||
The notation itself is pretty simple.
|
||||
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
|
||||
- There is still alot of speed left on the table
|
||||
- Reduce the amount of allocations
|
||||
|
|
Loading…
Add table
Reference in a new issue