Show / Hide Table of Contents

Class BlockWriter

Provides useful functions for writing a block as a piece of LoliScript code.

Inheritance
System.Object
System.MarshalByRefObject
System.IO.TextWriter
System.IO.StringWriter
BlockWriter
Implements
System.IDisposable
Inherited Members
System.IO.StringWriter.Close()
System.IO.StringWriter.Dispose(System.Boolean)
System.IO.StringWriter.GetStringBuilder()
System.IO.StringWriter.Write(System.Char)
System.IO.StringWriter.Write(System.Char[], System.Int32, System.Int32)
System.IO.StringWriter.Write(System.String)
System.IO.StringWriter.WriteAsync(System.Char)
System.IO.StringWriter.WriteAsync(System.String)
System.IO.StringWriter.WriteAsync(System.Char[], System.Int32, System.Int32)
System.IO.StringWriter.WriteLineAsync(System.Char)
System.IO.StringWriter.WriteLineAsync(System.String)
System.IO.StringWriter.WriteLineAsync(System.Char[], System.Int32, System.Int32)
System.IO.StringWriter.FlushAsync()
System.IO.StringWriter.ToString()
System.IO.StringWriter.Encoding
System.IO.TextWriter.Null
System.IO.TextWriter.CoreNewLine
System.IO.TextWriter.Dispose()
System.IO.TextWriter.Flush()
System.IO.TextWriter.Synchronized(System.IO.TextWriter)
System.IO.TextWriter.Write(System.Char[])
System.IO.TextWriter.Write(System.Boolean)
System.IO.TextWriter.Write(System.Int32)
System.IO.TextWriter.Write(System.UInt32)
System.IO.TextWriter.Write(System.Int64)
System.IO.TextWriter.Write(System.UInt64)
System.IO.TextWriter.Write(System.Single)
System.IO.TextWriter.Write(System.Double)
System.IO.TextWriter.Write(System.Decimal)
System.IO.TextWriter.Write(System.Object)
System.IO.TextWriter.Write(System.String, System.Object)
System.IO.TextWriter.Write(System.String, System.Object, System.Object)
System.IO.TextWriter.Write(System.String, System.Object, System.Object, System.Object)
System.IO.TextWriter.Write(System.String, System.Object[])
System.IO.TextWriter.WriteLine()
System.IO.TextWriter.WriteLine(System.Char)
System.IO.TextWriter.WriteLine(System.Char[])
System.IO.TextWriter.WriteLine(System.Char[], System.Int32, System.Int32)
System.IO.TextWriter.WriteLine(System.Boolean)
System.IO.TextWriter.WriteLine(System.Int32)
System.IO.TextWriter.WriteLine(System.UInt32)
System.IO.TextWriter.WriteLine(System.Int64)
System.IO.TextWriter.WriteLine(System.UInt64)
System.IO.TextWriter.WriteLine(System.Single)
System.IO.TextWriter.WriteLine(System.Double)
System.IO.TextWriter.WriteLine(System.Decimal)
System.IO.TextWriter.WriteLine(System.String)
System.IO.TextWriter.WriteLine(System.Object)
System.IO.TextWriter.WriteLine(System.String, System.Object)
System.IO.TextWriter.WriteLine(System.String, System.Object, System.Object)
System.IO.TextWriter.WriteLine(System.String, System.Object, System.Object, System.Object)
System.IO.TextWriter.WriteLine(System.String, System.Object[])
System.IO.TextWriter.WriteAsync(System.Char[])
System.IO.TextWriter.WriteLineAsync(System.Char[])
System.IO.TextWriter.WriteLineAsync()
System.IO.TextWriter.FormatProvider
System.IO.TextWriter.NewLine
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.CreateObjRef(System.Type)
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: RuriLib.LS
Assembly: RuriLib.dll
Syntax
public class BlockWriter : StringWriter, IDisposable

Constructors

| Improve this Doc View Source

BlockWriter(Type, Boolean, Boolean)

Creates a new BlockWriter for the given block type and with the given settings.

Declaration
public BlockWriter(Type blockType, bool indented = true, bool disabled = false)
Parameters
Type Name Description
System.Type blockType

The Type of the block to write

System.Boolean indented

Whether the code can be indented on multiple lines for readability

System.Boolean disabled

Whether the block to write is disabled

Methods

| Improve this Doc View Source

Arrow()

Writes an Arrow (->) and a space.

Declaration
public BlockWriter Arrow()
Returns
Type Description
BlockWriter

The BlockWriter itself

| Improve this Doc View Source

Boolean(Boolean, String)

Writes a boolean with the syntax Name=Value and a space.

Declaration
public BlockWriter Boolean(bool boolean, string property)
Parameters
Type Name Description
System.Boolean boolean

The boolean value to write

System.String property

The name of the property

Returns
Type Description
BlockWriter
| Improve this Doc View Source

CheckDefault(Object, String)

Checks if a property has the default value.

Declaration
public bool CheckDefault(object value, string property)
Parameters
Type Name Description
System.Object value

The value that needs to be checked

System.String property

The name of the property that contains that value

Returns
Type Description
System.Boolean

Whether the property has the default value or not

| Improve this Doc View Source

Indent(Int32)

Writes a linebreak and a given number of spaces on the next line.

Declaration
public BlockWriter Indent(int spacing = 1)
Parameters
Type Name Description
System.Int32 spacing

The amount of spacing to perform. A spacing of value 1 means two blank space characters, 2 means 4 etc.

Returns
Type Description
BlockWriter
| Improve this Doc View Source

Integer(Int32, String)

Writes an integer value and a space.

Declaration
public BlockWriter Integer(int integer, string property = "")
Parameters
Type Name Description
System.Int32 integer

The integer value to write

System.String property

The name of the property of the block. If the value is the default one, it will not be written. Do not set this parameter to always write the variable.

Returns
Type Description
BlockWriter

The BlockWriter itself

| Improve this Doc View Source

Label(String)

Writes a block label as a # sign, the label name and a space.

Declaration
public BlockWriter Label(string label)
Parameters
Type Name Description
System.String label

The label of the block

Returns
Type Description
BlockWriter

The BlockWriter itself

| Improve this Doc View Source

Literal(String, String)

Writes a literal value (with escaped double-quotes) wrapped by double-quotes and a space.

Declaration
public BlockWriter Literal(string literal, string property = "")
Parameters
Type Name Description
System.String literal

The literal value to write

System.String property

The name of the property of the block. If the value is the default one, it will not be written. Do not set this parameter to always write the variable.

Returns
Type Description
BlockWriter

The BlockWriter itself

| Improve this Doc View Source

Return()

Writes a linebreak.

Declaration
public BlockWriter Return()
Returns
Type Description
BlockWriter
| Improve this Doc View Source

Token(Object, String)

Writes any type of variable as a token (by calling its default ToString method) and a space.

Declaration
public BlockWriter Token(dynamic token, string property = "")
Parameters
Type Name Description
System.Object token

The variable to write

System.String property

The name of the property of the block. If the value is the default one, it will not be written. Do not set this parameter to always write the variable.

Returns
Type Description
BlockWriter

The BlockWriter itself

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX