//------------------------------------------------------------ // CTextReader.Assign // /// <summary></summary> /// <param name="src"></param> //------------------------------------------------------------ internal void Assign(CTextReader src) { DebugUtil.Assert(src != null); this.text = src.text; this.Index = src.Index; }
//------------------------------------------------------------ // CTextReader.Substring // /// <summary> /// Return the substring of this.text [this.Index, end.Index) /// </summary> /// <param name="end"></param> /// <returns></returns> //------------------------------------------------------------ internal string Substring(CTextReader end) { DebugUtil.Assert(this.text != null && end != null && end.text != null); if (this.text != end.text) { return(null); } if (!this.ValidIndex() || !end.ValidIndex()) { return(null); } if (this.Index >= end.Index) { return(null); } return(this.text.Substring(this.Index, end.Index - this.Index)); }
//------------------------------------------------------------ // CTextReader Constructor (4) // /// <summary></summary> /// <param name="src"></param> //------------------------------------------------------------ internal CTextReader(CTextReader src) { Assign(src); }