Class TomlTypeConverter
Serializer/deserializer used by the config system.
Inheritance
System.Object
TomlTypeConverter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: BepInEx.dll
Syntax
public static class TomlTypeConverter
Methods
Add a new type converter for a given type.
If a different converter is already added, this call is ignored and false is returned.
Declaration
public static bool AddConverter(Type type, TypeConverter converter)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Check if a given type can be converted to and from string.
Declaration
public static bool CanConvert(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
Convert object of a given type to a string using available converters.
Declaration
public static string ConvertToString(object value, Type valueType)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
System.Type |
valueType |
|
Returns
Type |
Description |
System.String |
|
Convert string to an object of a given type using available converters.
Declaration
public static object ConvertToValue(string value, Type valueType)
Parameters
Type |
Name |
Description |
System.String |
value |
|
System.Type |
valueType |
|
Returns
Type |
Description |
System.Object |
|
Convert string to an object of a given type using available converters.
Declaration
public static T ConvertToValue<T>(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type Parameters
Get a converter for a given type if there is any.
Declaration
public static TypeConverter GetConverter(Type valueType)
Parameters
Type |
Name |
Description |
System.Type |
valueType |
|
Returns
Give a list of types with registered converters.
Declaration
public static IEnumerable<Type> GetSupportedTypes()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|