C# Class Iaik.Utils.SimpleFormatter

Simple Textformatter {[Name]:ALIGNMENT:WIDTH:FILLCHAR} or {index:ALIGNMENT:WIDTH:FILLCHAR} or {"text":...} [Name] is the name of a defined text macro index is the index in the passed parameter list "text" is a freestyle text to be formatted ALIGNMENT =LN ... left-aligned and do not fill =LF ... left aligned and fill up = M ... centered = R ... right-aligned WIDTH Tells the formatter to which width the text should be aligned FILLCHAR For LF and R. Char used to fill
ファイルを表示 Open project: areiter/InMemoryFuzzing Class Usage Examples

Public Methods

Method Description
DefineTextMacro ( string name, string value ) : void

Defines a text macro

Format ( string format ) : string

Formats a string, see class description for formatting instructions

StaticFormat ( string format ) : string
UndefineTextMacro ( string name ) : void

Removes a text macro

Private Methods

Method Description
EscapeSafeSplit ( string toEscape, char splitBy ) : string[]
FindNextNotEscaped ( int offset, string findIn, string toFind ) : int

Finds the next not escaped character (tofind)

FindStartMarker ( int offset, string str ) : int?

Finds the next formatable part "{..."

FormatLF ( int length, string val, char fillChar ) : string
FormatLN ( int length, string val ) : string
FormatM ( int length, string val, char fillChar ) : string
FormatPacket ( string format, object args ) : string

Does the formating stuff

FormatR ( int length, string val, char fillChar ) : string
GetFormatPacket ( int &offset, string str ) : string

Gets the formatable packet. It assumes that offset is already located after the start marker "{"

StringifyParameter ( object arg ) : string
Unescape ( string escaped ) : string

Method Details

DefineTextMacro() public method

Defines a text macro
public DefineTextMacro ( string name, string value ) : void
name string
value string
return void

Format() public method

Formats a string, see class description for formatting instructions
public Format ( string format ) : string
format string
return string

StaticFormat() public static method

public static StaticFormat ( string format ) : string
format string
return string

UndefineTextMacro() public method

Removes a text macro
public UndefineTextMacro ( string name ) : void
name string
return void