seztion-parser
2.0.0
See the version list below for details.
dotnet add package seztion-parser --version 2.0.0
NuGet\Install-Package seztion-parser -Version 2.0.0
<PackageReference Include="seztion-parser" Version="2.0.0" />
paket add seztion-parser --version 2.0.0
#r "nuget: seztion-parser, 2.0.0"
// Install seztion-parser as a Cake Addin #addin nuget:?package=seztion-parser&version=2.0.0 // Install seztion-parser as a Cake Tool #tool nuget:?package=seztion-parser&version=2.0.0
seztion-parser
seztion-parser is a class library used to read data from each section of a file (the file extension can be any, e.g. .INI
).
There is a history behind why this library exists.
Some time ago I was creating a gamemode in SA-MP (San Andreas Multiplayer, a multiplayer mod for GTA San Andrea) that was based on two teams (Alpha and Beta), so I needed to somehow store the spawn positions (is the location where the player appears on the map) of a given map (the place where the player plays).
Then it occurred to me that I could save the spawn positions in a file in this way:
# Section(1).
[Alpha]
# Spawn positions - Alpha Team.
2548.7009,-1283.2224,1060.9844,230.3022
2565.8301,-1281.7773,1065.3672,238.1356
2575.7759,-1283.3206,1065.3672,177.9750
2580.8525,-1284.6443,1065.3579,88.0476
2568.5518,-1283.6564,1060.9844,181.0851
# Section(2).
[Beta]
# Spawn positions - Beta Team.
2532.1660,-1283.6971,1031.4219,270.0725
2532.5823,-1292.2178,1031.4219,275.7126
2532.9485,-1302.3477,1031.4219,269.4458
2541.2852,-1303.9135,1031.4219,269.4458
2542.1389,-1293.7726,1031.4219,262.8658
And this is where the seztion-parzer library comes into play, as it is simple to extract this data with this library. I didn't want to use a database for this, I wanted something very simple and this is what I came up with at the time.
Don't forget to visit the official library website where you can find API documentation, articles and diagrams.
Installation
If you're an hardcore and want to do it manually, you must add the following to the csproj
file:
<PackageReference Include="seztion-parser" Version="1.0.2" />
If you're want to install the package from Visual Studio, you must open the project/solution in Visual Studio, and open the console using the Tools > NuGet Package Manager > Package Manager Console command and run the install command:
Install-Package seztion-parser
If you are making use of the dotnet CLI, then run the following in your terminal:
dotnet add package seztion-parser
Usage
// Import all namespace types.
using SeztionParser.Facades;
// Load the sections file.
var sections = SectionsFile.Load("my_file.ini");
// This prints the data of the 'Alpha' section.
foreach (var data in sections["Alpha"])
Console.WriteLine(data);
For more information, see the articles.
Contribution
If you want to contribute in this project, simply fork the repository, make changes and then create a pull request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.