示例#1
0
    public bool ScanToTag(string tag)
    {
        if (Length <= 0)
        {
            return(false);
        }

        if (cachedFile != null)
        {
            ES2Tag thisTag;
            if (!(thisTag = cachedFile.GetTag(tag)).isNull)
            {
                currentTag      = thisTag;
                stream.Position = thisTag.settingsPosition;
                return(true);
            }
        }

        Reset();         // Reset so that we start from the beginning.

        while (Next())
        {
            if (currentTag.tag == tag)
            {
                return(true);
            }
        }
        return(false);
    }
示例#2
0
    public override string ToString()
    {
        string logString = "";

        foreach (KeyValuePair <string, ES2Tag> item in tagCache)
        {
            ES2Tag tag = item.Value;
            logString += "{tag:" + tag.tag + ", position:" + tag.position + ", settingsPosition:" + tag.settingsPosition + ", nextTagPosition:" + tag.nextTagPosition + "}\n";
        }
        return(logString);
    }
示例#3
0
    public ES2Tag AddOrUpdateTag(string tag, long position, long settingsPosition, long nextTagPosition)
    {
        ES2Tag cachedTag;

        if (!tagCache.TryGetValue(tag, out cachedTag))
        {
            return(tagCache[tag] = new ES2Tag(tag, position, settingsPosition, nextTagPosition));
        }

        cachedTag.position         = position;
        cachedTag.settingsPosition = settingsPosition;
        cachedTag.nextTagPosition  = nextTagPosition;
        return(cachedTag);
    }
示例#4
0
 public void AddTag(ES2Tag tag)
 {
     tagCache[tag.tag] = tag;
 }
示例#5
0
 public void Reset()
 {
     stream.Position = 0;
     currentTag      = new ES2Tag(true);
 }