Class ConfUtils
Provides configuration-related utility extensions
Inheritance
System.Object
ConfUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos
Assembly: Azos.dll
Syntax
public static class ConfUtils
Methods
AsLaconicConfig(String, ConfigSectionNode, String, ConvertErrorHandling)
Tries to convert object to laconic config content and parse i. This is a shortcut to ObjectValueConversion.AsLaconicConfig(object)
Declaration
public static ConfigSectionNode AsLaconicConfig(this string val, ConfigSectionNode dflt = null, string wrapRootName = "azos", ConvertErrorHandling handling = ConvertErrorHandling.ReturnDefault)
Parameters
Returns
AsTextSnippet(IConfigSectionNode, Int32, String)
Returns the content of config node as terse laconic string capped at the specified max len (64 by default).
Warning: the returned laconic is mostly used for logging and error reporting, it is not possible to
read it back into config node as it is for info purposes only
Declaration
public static string AsTextSnippet(this IConfigSectionNode node, int len = 0, string ellipsis = null)
Parameters
Returns
Type |
Description |
System.String |
|
EvaluateVars(String, IEnvironmentVariableResolver, IMacroRunner)
Evaluates variables in a context of optional variable resolver and macro runner
Declaration
public static string EvaluateVars(this string line, IEnvironmentVariableResolver envResolver = null, IMacroRunner macroRunner = null)
Parameters
Returns
Type |
Description |
System.String |
|
EvaluateVarsInConfigScope(String, Configuration)
Evaluates variables in a context of optional configuration supplied as config object
Declaration
public static string EvaluateVarsInConfigScope(this string line, Configuration scopeConfig = null)
Parameters
Type |
Name |
Description |
System.String |
line |
|
Configuration |
scopeConfig |
|
Returns
Type |
Description |
System.String |
|
EvaluateVarsInDictionaryScope(String, IDictionary<String, Object>, IEnvironmentVariableResolver, IMacroRunner)
Evaluates variables in a context of optional configuration supplied as dictionary which is converted to attributes
Declaration
public static string EvaluateVarsInDictionaryScope(this string line, IDictionary<string, object> dict = null, IEnvironmentVariableResolver envResolver = null, IMacroRunner macroRunner = null)
Parameters
Returns
Type |
Description |
System.String |
|
EvaluateVarsInXMLConfigScope(String, String, IEnvironmentVariableResolver, IMacroRunner)
Evaluates variables in a context of optional configuration supplied in XML format
Declaration
public static string EvaluateVarsInXMLConfigScope(this string line, string xmlScope = null, IEnvironmentVariableResolver envResolver = null, IMacroRunner macroRunner = null)
Parameters
Returns
Type |
Description |
System.String |
|
ToConfigAttributes(IDictionary<String, Object>)
Converts dictionary into configuration where every original node gets represented as an attribute of config's root
Declaration
public static Configuration ToConfigAttributes(this IDictionary<string, object> dict)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
dict |
|
Returns
ToConfigSections(IDictionary<String, Object>)
Converts dictionary into configuration where every original node gets represented as a sub-section of config's root
Declaration
public static Configuration ToConfigSections(this IDictionary<string, object> dict)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
dict |
|
Returns