This class stores the begin and end tags for an XML element as byte arrays. This is useful in conjuction with the ElementBounds class, which is useful to avoid creating XElement objects and thus consuming time and memory.
Пример #1
0
 /// <summary>
 /// Constructor for an element to be found anywhere inside the byte array.
 /// </summary>
 public ElementBounds(byte[] xmlBytes, ElementTags tags)
 {
     m_xmlBytes     = xmlBytes;
     m_tags         = tags;
     BeginTagOffset = xmlBytes.IndexOfSubArray(tags.BeginTag);
     if (BeginTagOffset >= 0)
     {
         EndOfStartTag = xmlBytes.IndexOfSubArray(s_endXmlTag, BeginTagOffset);
         EndTagOffset  = xmlBytes.IndexOfSubArray(tags.EndTag, BeginTagOffset + tags.BeginTag.Length);
     }
     else
     {
         EndOfStartTag = -1;
         EndTagOffset  = -1;
     }
     SetLength(tags.EndTag.Length);
 }
Пример #2
0
		/// <summary>
		/// Constructor for an element to be found inside another element that was previously
		/// located in the byte array.
		/// </summary>
		public ElementBounds(byte[] xmlBytes, ElementTags tags, ElementBounds bounds)
		{
			m_xmlBytes = xmlBytes;
			m_tags = tags;
			Reset(bounds.BeginTagOffset, bounds.EndTagOffset);
		}
Пример #3
0
		public ElementBounds(byte[] xmlBytes, ElementTags tags, int ichMin, int ichLim)
		{
			m_xmlBytes = xmlBytes;
			m_tags = tags;
			Reset(ichMin, ichLim);
		}
Пример #4
0
		/// <summary>
		/// Constructor for an element to be found anywhere inside the byte array.
		/// </summary>
		public ElementBounds(byte[] xmlBytes, ElementTags tags)
		{
			m_xmlBytes = xmlBytes;
			m_tags = tags;
			BeginTagOffset = xmlBytes.IndexOfSubArray(tags.BeginTag);
			if (BeginTagOffset >= 0)
			{
				EndOfStartTag = xmlBytes.IndexOfSubArray(s_endXmlTag, BeginTagOffset);
				EndTagOffset = xmlBytes.IndexOfSubArray(tags.EndTag, BeginTagOffset + tags.BeginTag.Length);
			}
			else
			{
				EndOfStartTag = -1;
				EndTagOffset = -1;
			}
			SetLength(tags.EndTag.Length);
		}
Пример #5
0
 /// <summary>
 /// Constructor for an element to be found inside another element that was previously
 /// located in the byte array.
 /// </summary>
 public ElementBounds(byte[] xmlBytes, ElementTags tags, ElementBounds bounds)
 {
     m_xmlBytes = xmlBytes;
     m_tags     = tags;
     Reset(bounds.BeginTagOffset, bounds.EndTagOffset);
 }
Пример #6
0
 public ElementBounds(byte[] xmlBytes, ElementTags tags, int ichMin, int ichLim)
 {
     m_xmlBytes = xmlBytes;
     m_tags     = tags;
     Reset(ichMin, ichLim);
 }