Show / Hide Table of Contents

Class Toml

Main Nett API access.

Inheritance
System.Object
Toml
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()
Namespace: Nett
Assembly: Nett.dll
Syntax
public static class Toml

Fields

| Improve this Doc View Source

FileExtension

The TOML standard file extension '.toml'.

Declaration
public const string FileExtension = ".toml"
Field Value
Type Description
System.String

Methods

| Improve this Doc View Source

Create()

Creates a empty TOML table.

Declaration
public static TomlTable Create()
Returns
Type Description
TomlTable

A empty table instance created with the default config.

Remarks

The TOML table construction process can be modified via a TomlConfig object. Thew newly created table will get associated with the config permanently after creation is done.

For more info on how to use config objects to modify Nett's behavior see TomlConfigs.

| Improve this Doc View Source

Create(TomlSettings)

Creates a empty TOML table.

Declaration
public static TomlTable Create(TomlSettings settings)
Parameters
Type Name Description
TomlSettings settings

The config to use, to create the table.

Returns
Type Description
TomlTable

A new empty table created with the given config.

Remarks

The TOML table construction process can be modified via a TomlConfig object. Thew newly created table will get associated with the config permanently after creation is done.

For more info on how to use config objects to modify Nett's behavior see TomlConfigs.

Exceptions
Type Condition
System.ArgumentNullException

config is null.

| Improve this Doc View Source

Create<T>(T)

Creates a new TOML table from a given CLR object.

Declaration
public static TomlTable Create<T>(T obj)
Parameters
Type Name Description
T obj

The CLR object instance for that the TOML table will be created.

Returns
Type Description
TomlTable

A new TomlTable created with the default config, equivalent to the passed CLR object.

Type Parameters
Name Description
T

The type of the CLR object.

Remarks

The TOML table will contain rows mapped from CLR types & objects to TOML primitives. This mapping will be done for all public properties of the object.

Properties can be ignored via the TomlIgnoreAttribute or using a accordingly set up @"Nett.TomlConfig" to create the table.

The TOML table construction process can be modified via a TomlConfig object. Thew newly created table will get associated with the config permanently after creation is done.

For more info on how to use config objects to modify Nett's behavior see TomlConfigs.

Exceptions
Type Condition
System.ArgumentNullException

obj is null.

| Improve this Doc View Source

Create<T>(T, TomlSettings)

Creates a TOML table from a given CLR object.

Declaration
public static TomlTable Create<T>(T obj, TomlSettings settings)
Parameters
Type Name Description
T obj

The CLR object instance for that the TOML table will be created.

TomlSettings settings

The config to use for the creation.

Returns
Type Description
TomlTable

A new table representing the CLR object. The table is associated with the given config.

Type Parameters
Name Description
T

The type of the CLR object.

Remarks

The TOML table construction process can be modified via a TomlConfig object. Thew newly created table will get associated with the config permanently after creation is done.

For more info on how to use config objects to modify Nett's behavior see TomlConfigs.

| Improve this Doc View Source

ReadFile(FileStream)

Declaration
public static TomlTable ReadFile(FileStream stream)
Parameters
Type Name Description
System.IO.FileStream stream
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadFile(FileStream, TomlSettings)

Declaration
public static TomlTable ReadFile(FileStream stream, TomlSettings settings)
Parameters
Type Name Description
System.IO.FileStream stream
TomlSettings settings
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadFile(String)

Reads the TOML contents from some file and maps it into a TomlTable structure.

Declaration
public static TomlTable ReadFile(string filePath)
Parameters
Type Name Description
System.String filePath

The absolute or relative path to the file.

Returns
Type Description
TomlTable

A TomlTable corresponding to the file content.

Remarks

Uses the default TOML settings while processing the file.

| Improve this Doc View Source

ReadFile(String, TomlSettings)

Reads the TOML contents from some file and maps it into a TomlTable structure.

Declaration
public static TomlTable ReadFile(string filePath, TomlSettings settings)
Parameters
Type Name Description
System.String filePath

The absolute or relative path to the file.

TomlSettings settings

The settings used to process the TOML content.

Returns
Type Description
TomlTable

A TomlTablecorresponding to the file content.

| Improve this Doc View Source

ReadFile<T>(FileStream)

Declaration
public static T ReadFile<T>(FileStream stream)
Parameters
Type Name Description
System.IO.FileStream stream
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadFile<T>(FileStream, TomlSettings)

Declaration
public static T ReadFile<T>(FileStream stream, TomlSettings settings)
Parameters
Type Name Description
System.IO.FileStream stream
TomlSettings settings
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadFile<T>(String)

Reads the TOML contents from some file and converts it to a CLR object.

Declaration
public static T ReadFile<T>(string filePath)
Parameters
Type Name Description
System.String filePath

The absolute or relative path to the file.

Returns
Type Description
T

A CLR object representing the TOML contents of the file.

Type Parameters
Name Description
T

The type of the CLR object.

Remarks

Uses the default TomlSettings

Exceptions
Type Condition
System.ArgumentNullException

If filePath is null.

| Improve this Doc View Source

ReadFile<T>(String, TomlSettings)

Reads the TOML contents from some file and converts it to a CLR object.

Declaration
public static T ReadFile<T>(string filePath, TomlSettings settings)
Parameters
Type Name Description
System.String filePath

The absolute or relative path to the file.

TomlSettings settings

The settings used to process the TOML content.

Returns
Type Description
T

A CLR object representing the TOML contents of the file.

Type Parameters
Name Description
T

The type of the CLR object.

Exceptions
Type Condition
System.ArgumentNullException

If filePath is null.

System.ArgumentNullException

If settings is null

| Improve this Doc View Source

ReadStream(Stream)

Declaration
public static TomlTable ReadStream(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadStream(Stream, TomlSettings)

Declaration
public static TomlTable ReadStream(Stream stream, TomlSettings settings)
Parameters
Type Name Description
System.IO.Stream stream
TomlSettings settings
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadStream<T>(Stream)

Declaration
public static T ReadStream<T>(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadStream<T>(Stream, TomlSettings)

Declaration
public static T ReadStream<T>(Stream stream, TomlSettings settings)
Parameters
Type Name Description
System.IO.Stream stream
TomlSettings settings
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadString(String)

Declaration
public static TomlTable ReadString(string toRead)
Parameters
Type Name Description
System.String toRead
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadString(String, TomlSettings)

Declaration
public static TomlTable ReadString(string toRead, TomlSettings settings)
Parameters
Type Name Description
System.String toRead
TomlSettings settings
Returns
Type Description
TomlTable
| Improve this Doc View Source

ReadString<T>(String)

Declaration
public static T ReadString<T>(string toRead)
Parameters
Type Name Description
System.String toRead
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadString<T>(String, TomlSettings)

Declaration
public static T ReadString<T>(string toRead, TomlSettings settings)
Parameters
Type Name Description
System.String toRead
TomlSettings settings
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteFile(TomlTable, String)

Declaration
public static void WriteFile(TomlTable table, string filePath)
Parameters
Type Name Description
TomlTable table
System.String filePath
| Improve this Doc View Source

WriteFile(TomlTable, String, TomlSettings)

Declaration
public static void WriteFile(TomlTable table, string filePath, TomlSettings settings)
Parameters
Type Name Description
TomlTable table
System.String filePath
TomlSettings settings
| Improve this Doc View Source

WriteFile<T>(T, String)

Declaration
public static void WriteFile<T>(T obj, string filePath)
Parameters
Type Name Description
T obj
System.String filePath
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteFile<T>(T, String, TomlSettings)

Declaration
public static void WriteFile<T>(T obj, string filePath, TomlSettings settings)
Parameters
Type Name Description
T obj
System.String filePath
TomlSettings settings
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteStream(TomlTable, Stream)

Declaration
public static void WriteStream(TomlTable table, Stream outStream)
Parameters
Type Name Description
TomlTable table
System.IO.Stream outStream
| Improve this Doc View Source

WriteStream<T>(T, Stream)

Declaration
public static void WriteStream<T>(T obj, Stream output)
Parameters
Type Name Description
T obj
System.IO.Stream output
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteStream<T>(T, Stream, TomlSettings)

Declaration
public static void WriteStream<T>(T obj, Stream outStream, TomlSettings settings)
Parameters
Type Name Description
T obj
System.IO.Stream outStream
TomlSettings settings
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteString<T>(T)

Declaration
public static string WriteString<T>(T obj)
Parameters
Type Name Description
T obj
Returns
Type Description
System.String
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteString<T>(T, TomlSettings)

Declaration
public static string WriteString<T>(T obj, TomlSettings settings)
Parameters
Type Name Description
T obj
TomlSettings settings
Returns
Type Description
System.String
Type Parameters
Name Description
T
  • Improve this Doc
  • View Source
Back to top Generated by DocFX