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); }
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); }
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); }
public void AddTag(ES2Tag tag) { tagCache[tag.tag] = tag; }
public void Reset() { stream.Position = 0; currentTag = new ES2Tag(true); }