public static PkgdefTokenizer Create(int startIndex, Iterator <char> characters, Action <PkgdefIssue> onIssue) { PreCondition.AssertGreaterThanOrEqualTo(startIndex, 0, nameof(startIndex)); PreCondition.AssertNotNull(characters, "characters"); return(new PkgdefTokenizer(CurrentIndexIterator.Create(startIndex, characters), onIssue)); }
public static PkgdefTokenizer Create(int startIndex, string text, Action <PkgdefIssue> onIssue) { PreCondition.AssertGreaterThanOrEqualTo(startIndex, 0, nameof(startIndex)); PreCondition.AssertNotNull(text, "text"); return(PkgdefTokenizer.Create(startIndex, Iterator.Create(text), onIssue)); }
public PkgdefToken(int startIndex, string text, PkgdefTokenType tokenType) { PreCondition.AssertGreaterThanOrEqualTo(startIndex, 0, nameof(startIndex)); PreCondition.AssertNotNullAndNotEmpty(text, nameof(text)); this.startIndex = startIndex; this.text = text; this.tokenType = tokenType; }
/// <summary> /// Create a new PkgdefIssue object. /// </summary> /// <param name="startIndex">The character index that the issue starts on.</param> /// <param name="length">The number of characters that the issue spans over.</param> /// <param name="message">The message that describes the issue.</param> public PkgdefIssue(int startIndex, int length, string message) { PreCondition.AssertGreaterThanOrEqualTo(startIndex, 0, nameof(startIndex)); PreCondition.AssertGreaterThanOrEqualTo(length, 1, nameof(length)); PreCondition.AssertNotNullAndNotEmpty(message, nameof(message)); this.startIndex = startIndex; this.length = length; this.message = message; }
internal static PkgdefRegistryKeyDataItemSegment ParseRegistryKeyDataItem(int startIndex, string text) { PreCondition.AssertGreaterThanOrEqualTo(startIndex, 0, nameof(startIndex)); PreCondition.AssertNotNullAndNotEmpty(text, nameof(text)); PreCondition.AssertOneOf(text[0], "@\"", "text[0]"); Action <PkgdefIssue> onIssue = PkgdefDocument.IgnoreIssue; PkgdefTokenizer tokenizer = PkgdefTokenizer.Create(startIndex, text, onIssue); tokenizer.Next(); return(PkgdefDocument.ParseRegistryKeyDataItem(tokenizer, onIssue)); }
/// <summary> /// Get the index directly after (not contained by) this PkgdefSegment. /// </summary> public virtual int GetAfterEndIndex() { PreCondition.AssertGreaterThanOrEqualTo(this.GetLength(), 1, "this.GetLength()"); return(this.GetStartIndex() + this.GetLength()); }
/// <summary> /// Get the last index that is contained by this PkgdefToken. /// </summary> public int GetEndIndex() { PreCondition.AssertGreaterThanOrEqualTo(this.GetLength(), 1, "this.GetLength()"); return(this.GetAfterEndIndex() - 1); }