Class ReaderJson
Reader .json files with replacing some variables
Inheritance
object
ReaderJson
Namespace: BuildSystem.SettingsReader
Assembly: BuildSystem.ManagerObject.Interfaces.dll
Syntax
public class ReaderJson : Object
Constructors
ReaderJson(ILogger?)
Reader of settings files
Declaration
public ReaderJson(ILogger? logger)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger |
Fields
KeyDefines
Key in JSON with info for Defines
Declaration
public const string KeyDefines = "defines"
Field Value
Type | Description |
---|---|
string |
KeyVars
Key in JSON with info for LocalVars
Declaration
public const string KeyVars = "vars"
Field Value
Type | Description |
---|---|
string |
ValueDefineInherit
Value in KeyDefines to say that we should add new defines without clearing existing list
Declaration
public const string ValueDefineInherit = "inherited"
Field Value
Type | Description |
---|---|
string |
Properties
Defines
Defines when reading settings
Declaration
public HashSet<string> Defines { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.HashSet<><string> |
LocalVars
Variables when reading settings
Declaration
public Dictionary<string, string?> LocalVars { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<,><string, string> |
RelativeFolder
Folder, which is relative to setting values. This is folder, where all input .json files exist
Declaration
public string? RelativeFolder { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Clone()
Copy of current instance as new instance
Declaration
public ReaderJson Clone()
Returns
Type | Description |
---|---|
ReaderJson |
ReadFiles(string[], bool)
Read group of files. If they have same keys, will left only from the last files
Declaration
public JsonObject ReadFiles(string[] files, bool updateRules = false)
Parameters
Type | Name | Description |
---|---|---|
string[] | files | Files to be read |
bool | updateRules | Update self rules for reading in the next time |
Returns
Type | Description |
---|---|
System.Text.Json.Nodes.JsonObject |
ReadRules(string[])
Read only rules from group of files
Declaration
public void ReadRules(string[] files)
Parameters
Type | Name | Description |
---|---|---|
string[] | files |