Cobilas.Core.Net4x 1.4.2

dotnet add package Cobilas.Core.Net4x --version 1.4.2
NuGet\Install-Package Cobilas.Core.Net4x -Version 1.4.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cobilas.Core.Net4x" Version="1.4.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cobilas.Core.Net4x --version 1.4.2
#r "nuget: Cobilas.Core.Net4x, 1.4.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Cobilas.Core.Net4x as a Cake Addin
#addin nuget:?package=Cobilas.Core.Net4x&version=1.4.2

// Install Cobilas.Core.Net4x as a Cake Tool
#tool nuget:?package=Cobilas.Core.Net4x&version=1.4.2

Cobilas Core

Descripition

Cobilas Core Net4x is a utility library for CSharp.

Json

(namespace:Cobilas.IO.Serialization.Json)<br> Only present in the NuGet version.<br> The static class Json grants static read and write functions.

JsonContractResolver

Used by JsonSerializer to resolve a JsonContract for a given Type. Furthermore, JsonContractResolver determines how the fields of an Object will be serialized.

ATLF(Arquivo de tradução de leitura facil)

ATLF (Easy to Read Translation File) can be used to create and load translations for apps.

#>Header
The use of the header is not mandatory.<#
#! version:/*std:1.0*/
#! encoding:/*utf-8*/

#> Comment <#
#> ATLF format(1.0) <#

#> Uni-line marking <#
#! Tag1:/*value1*/

#> Multi-line marking <#
#! Tag2:/*
value1
value2
value3
value4
*/

How to read ATLF

static void Main(string[] args) {
    using ATLFReader reader = ATLFReader.Create(@"C:\folder1\file.txt");
    reader.Reader();
    Console.WriteLine($"tag.value.1:{reader.GetTag("tag.value.1")}");
    Console.WriteLine($"tag.value.2:{reader.GetTag("tag.value.2")}");
    Console.WriteLine($"tag.value.3:{reader.GetTag("tag.value.3")}");
}

The other reading functions.

  • The ATLFNode[]:ATLFReader.GetHeader() function allows you to get the header tags.
  • The ATLFNode[]:ATLFReader.GetAllComments() function allows you to get all comments. The ATLFNode[]:ATLFReader.GetTagGroup(string path) function allows you to obtain tags that belong to the same path.
/*C:\folder1\file.txt
* #! version:/*std:1.0* /
* #! encoding:/*utf-8* /
* 
* #! tag.value.cop1:/*value1* /
* #! tag.value.map.cop1:/*value1* /
* #! tag.value.map.cop2:/*value1* /
* #! tag.value.cop2:/*value1* /
* #! tag.value.cop3:/*value1* /
*/
static void Main(string[] args) {
    using ATLFReader reader = ATLFReader.Create(@"C:\folder1\file.txt");
    reader.Reader();
    foreach(var item in reader.GetTagGroup("tag.value.map"))
        Console.WriteLine(item);
}

How to write ATLF

static void Main(string[] args) {
    using ATLFWriter writer = ATLFWriter.Create(File.OpenWrite(@"C:\folder1\file.txt"));
    writer.WriteHeader();//The header is not mandatory but if you add a header, call this function first.
    writer.WriteComment("my tag1");
    writer.WriteNode("tag1", "value1");
    writer.WriteWhitespace("\r\n");//This function is called automatically when the `Indent` property is `true`. By default the `Indent` property is `true`.
    writer.WriteComment("my tag2");
    writer.WriteNode("tag2", "value2");
    writer.WriteWhitespace(2, "\r\n");//This function is called automatically when the `Indent` property is `true`. By default the `Indent` property is `true`.
    writer.WriteComment("my tag3");
    writer.WriteNode("tag3", "value3");
}

Encoders and decoders

Regarding encoders and decoders, ATLF allows the creation of customized encoders and decoders.<br> To use a custom encoder or decoder, assign a version to your custom encoder or decoder using the Version property and then assign the version of the custom encoder or decoder in the TargetVersion property of the ATLFWriter and ATLFReader classes.<br>

Creating a custom encoding class

To create a custom encoding class, the class must inherit the ATLFVS10Encoding class.

Creating a custom decoding class

To create a custom decoding class, the class must inherit the ATLFVS10Decoding class.

Cobilas.Core.Net4x is on nuget.org

To include the package, open the .csproj file and add it.

<ItemGroup>
  <PackageReference Include="Cobilas.Core.Net4x" Version="1.4.0" />
</ItemGroup>

Or use command line.

dotnet add package Cobilas.Core.Net4x --version 1.4.0

Cobilas.Core.Net4x is on NPM

Include in npm package

"dependencies": {
    "com.cobilas.unity.core.net4x":"1.4.0"
}

Or use command line.

npm i com.cobilas.unity.core.net4x
Product 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cobilas.Core.Net4x:

Package Downloads
Cobilas.Godot.Utility

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.2 85 2/15/2024
1.4.1 88 2/5/2024
1.4.0 73 2/5/2024
1.3.1 63 2/2/2024
1.3.0 83 1/26/2024
1.2.0 70 1/24/2024
1.1.0 208 12/31/2023
1.0.0 120 12/12/2023