Class SmartFormatter
This class contains the Format method that constructs the composite string by invoking each extension.
Implements
Namespace: UnityEngine.Localization.SmartFormat
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public class SmartFormatter : ISerializationCallbackReceiver
Constructors
Name | Description |
---|---|
SmartFormatter() | Creates a new instance of SmartFormatter. |
Properties
Name | Description |
---|---|
FormatterExtensions | Gets the list of IFormatter formatter extensions. |
Parser | Gets or set the instance of the Parser |
Settings | Get the SmartSettings for Smart.Format |
SourceExtensions | Gets the list of ISource source extensions. |
Methods
Name | Description |
---|---|
AddExtensions(params IFormatter[]) | Adds each extensions to this formatter. Each extension must implement IFormatter. |
AddExtensions(params ISource[]) | Adds each extensions to this formatter. Each extension must implement ISource. |
Format(IList<object>, string) | Replaces one or more format items in a specified string with the string representation of a specific object. |
Format(IFormatProvider, IList<object>, string) | Replaces one or more format items in a specified string with the string representation of a specific object. |
Format(IFormatProvider, string, params object[]) | Replaces one or more format items in a specified string with the string representation of a specific object. |
Format(string, params object[]) | Replaces one or more format items in a specified string with the string representation of a specific object. |
Format(FormattingInfo) | Format the FormattingInfo argument. |
FormatInto(IOutput, string, params object[]) | Writes the formatting result into an IOutput instance. |
FormatWithCache(ref FormatCache, string, IList<object>) | Replaces one or more format items in a specified string with the string representation of a specific object, using the FormatCache. |
FormatWithCache(ref FormatCache, string, IFormatProvider, IList<object>) | Replaces one or more format items in a specified string with the string representation of a specific object, using the FormatCache. |
FormatWithCacheInto(ref FormatCache, IOutput, string, params object[]) | Writes the formatting result into an IOutput instance, using the FormatCache. |
GetFormatterExtension<T>() | Searches for a Formatter Extension of the given type, and returns it. This can be used to easily find and configure extensions. Returns null if the type cannot be found. |
GetNotEmptyFormatterExtensionNames() | Gets all names of registered formatter extensions which are not empty. |
GetSourceExtension<T>() | Searches for a Source Extension of the given type, and returns it. This can be used to easily find and configure extensions. Returns null if the type cannot be found. |
Events
Name | Description |
---|---|
OnFormattingFailure | Event raising, if an error occurs during formatting. |