Skip to content

Utils.StringParserQuick

robbyxp1 edited this page Oct 18, 2022 · 8 revisions

StringParserQuick Class

String Parser Quick for JSON system.

public class StringParserQuick :
QuickJSON.Utils.IStringParserQuick

Inheritance System.Object 🡒 StringParserQuick

Implements IStringParserQuick


Constructors


StringParserQuick.StringParserQuick(string, int) Constructor

Construct with line and optional position

public StringParserQuick(string l, int p=0);
Parameters

l System.String

p System.Int32


Properties


StringParserQuick.Left Property

Return number of character left

public int Left { get; }
Property Value

System.Int32


StringParserQuick.Line Property

Text of line in whole

public string Line { get; }
Property Value

System.String

Implements Line


StringParserQuick.Position Property

Current parse position

public int Position { get; }
Property Value

System.Int32

Implements Position


Methods


StringParserQuick.BackUp() Method

Backup one position

public void BackUp();

Implements BackUp()


StringParserQuick.GetChar() Method

Get next character. Space if at EOL.

public char GetChar();
Returns

System.Char

Implements GetChar()


StringParserQuick.IsCharMoveOn(char, bool) Method

Is this character at the current position, if so, skip it. Optionally skip space afterwards

public bool IsCharMoveOn(char t, bool skipspace=true);
Parameters

t System.Char

skipspace System.Boolean

Returns

System.Boolean

Implements IsCharMoveOn(char, bool)


StringParserQuick.IsEOL() Method

Is at End of Line

public bool IsEOL();
Returns

System.Boolean

Implements IsEOL()


StringParserQuick.IsStringMoveOn(string) Method

Is this string at the current position, if so, skip it and skip space

public bool IsStringMoveOn(string s);
Parameters

s System.String

Returns

System.Boolean

Implements IsStringMoveOn(string)


StringParserQuick.JNextNumber(bool) Method

Read next number: long, ulong, bigint or double.

public QuickJSON.JToken JNextNumber(bool sign);
Parameters

sign System.Boolean
True if negative. Sign has been removed

Returns

JToken
New JToken of number, Long, BigInt or Double. Null if failed

Implements JNextNumber(bool)


StringParserQuick.NextQuotedString(char, char[], bool) Method

Get the next quoted string into buffer. Quote has already been removed.

public int NextQuotedString(char quote, char[] buffer, bool replaceescape=false);
Parameters

quote System.Char
Quote character to stop on

buffer System.Char[]
Buffer to place string into

replaceescape System.Boolean
True to replace escape sequences \, /, \b, \f, \n, \r, \t, uNNNN

Returns

System.Int32
Number of characters in buffe. -1 if it runs out of buffer space

Implements NextQuotedString(char, char[], bool)


StringParserQuick.PeekChar() Method

Peek next character. Space if at EOL.

public char PeekChar();
Returns

System.Char

Implements PeekChar()


StringParserQuick.SkipSpace() Method

Skip all white space

public void SkipSpace();

Implements SkipSpace()

Clone this wiki locally