TomlTypeConverter Class
Definition
Section titled “Definition”Serializer/deserializer used by the config system.
public static class TomlTypeConverter
Inheritance object
Methods
Section titled “Methods”ConvertToString(object, Type)
Section titled “ConvertToString(object, Type)”Convert object of a given type to a string using available converters.
public static string ConvertToString(object value, Type valueType)
Parameters
Section titled “Parameters”value
object
valueType
Type
Returns
Section titled “Returns”ConvertToValue(string)
Section titled “ConvertToValue(string)”Convert string to an object of a given type using available converters.
public static T ConvertToValue<T>(string value)
Parameters
Section titled “Parameters”value
string
Returns
Section titled “Returns”T
ConvertToValue(string, Type)
Section titled “ConvertToValue(string, Type)”Convert string to an object of a given type using available converters.
public static object ConvertToValue(string value, Type valueType)
Parameters
Section titled “Parameters”value
string
valueType
Type
Returns
Section titled “Returns”GetConverter(Type)
Section titled “GetConverter(Type)”Get a converter for a given type if there is any.
public static TypeConverter GetConverter(Type valueType)
Parameters
Section titled “Parameters”valueType
Type
Returns
Section titled “Returns”AddConverter(Type, TypeConverter)
Section titled “AddConverter(Type, TypeConverter)”Add a new type converter for a given type. If a different converter is already added, this call is ignored and false is returned.
public static bool AddConverter(Type type, TypeConverter converter)
Parameters
Section titled “Parameters”type
Type
converter
TypeConverter
Returns
Section titled “Returns”CanConvert(Type)
Section titled “CanConvert(Type)”Check if a given type can be converted to and from string.
public static bool CanConvert(Type type)
Parameters
Section titled “Parameters”type
Type
Returns
Section titled “Returns”GetSupportedTypes()
Section titled “GetSupportedTypes()”Give a list of types with registered converters.
public static IEnumerable<Type> GetSupportedTypes()