# com.cobilas.unity.core.net4x

> C# NPM package for general use in apps and games.

Latest version **1.6.1** (published 2024-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install com.cobilas.unity.core.net4x
pnpm add com.cobilas.unity.core.net4x
yarn add com.cobilas.unity.core.net4x
bun add com.cobilas.unity.core.net4x
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.6.1 |
| Published | 2024-07-06 |
| First published | 2024-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 322.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BélicusBr |
| Maintainers | belicusbr |
| Keywords | CSharp, C#, net472, Unity3D |

## Links

- npm: https://www.npmjs.com/package/com.cobilas.unity.core.net4x
- Repository: https://github.com/BelicusBr/com.cobilas.cs.lib.core.net4x
- Homepage: https://github.com/BelicusBr/com.cobilas.cs.lib.core.net4x#readme
- Issues: https://github.com/BelicusBr/com.cobilas.cs.lib.core.net4x/issues
- npm.io page: https://npm.io/package/com.cobilas.unity.core.net4x

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.6.1 (latest) — 2024-07-06
- 1.5.0 — 2024-05-09
- 1.4.2 — 2024-02-15
- 1.4.1 — 2024-02-05
- 1.4.0 — 2024-02-05
- 1.3.1 — 2024-02-02
- 1.3.0 — 2024-01-26
- 1.2.2 — 2024-01-25
- 1.2.1 — 2024-01-24
- 1.2.0 — 2024-01-24

## README

# 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
```csharp
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.
```csharp
/*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
```csharp
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](https://www.nuget.org/packages/Cobilas.Core.Net4x) is on nuget.org
To include the package, open the `.csproj` file and add it.
```xml
<ItemGroup>
  <PackageReference Include="Cobilas.Core.Net4x" Version="1.4.0" />
</ItemGroup>
```
Or use command line.
```ps1
dotnet add package Cobilas.Core.Net4x --version 1.4.0
```
# [Cobilas.Core.Net4x](https://www.npmjs.com/package/com.cobilas.unity.core.net4x) is on NPM
Include in npm package
```json
"dependencies": {
    "com.cobilas.unity.core.net4x":"1.4.0"
}
```
Or use command line.
```ps1
npm i com.cobilas.unity.core.net4x
```

---
_Source: https://npm.io/package/com.cobilas.unity.core.net4x · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
