コード例 #1
0
ファイル: ES2Reader.cs プロジェクト: Finn1510/Fortech
    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
ファイル: ES2Reader.cs プロジェクト: Finn1510/Fortech
 public void Reset()
 {
     stream.Position = 0;
     currentTag      = new ES2Tag(true);
 }