Exemplo n.º 1
0
        /// <summary>
        /// Get <paramref name="tag_datum"/>'s reference path value
        /// </summary>
        /// <param name="tag_datum">A tag datum that exists in this cache instance</param>
        /// <returns>The path string linked to <paramref name="tag_datum"/>, or null if retrieval fails</returns>
        public string GetReferenceName(CacheIndex.Item tag_datum)
        {
            if (refManager == null || tag_datum == null)
            {
                return(null);
            }

            return(refManager[tag_datum.ReferenceName]);
        }
Exemplo n.º 2
0
        public CacheExtractionInfo(CacheFile cf, DatumIndex tag_datum, CacheExtractionArguments args)
        {
            var bd = Program.GetManager(cf.EngineVersion);

            Database       = bd.CreateCacheTagDatabase(cf.CacheId);
            DatabaseErrors = bd.CreateErrorTagDatabase();

            root_definition = cf.Index.Tags[tag_datum.Index];
            Reset(root_definition);

            Arguments = args;
            Arguments.CreateOutputDirectory();
        }
Exemplo n.º 3
0
        public bool TryAndFind(string name, TagInterface.TagGroup group, out CacheIndex.Item item)
        {
            item = null;

            DatumIndex reference_name;

            if (refManager.TryAndFind(group, name, out reference_name))
            {
                item = Array.Find(Index.Tags, ci => ci.ReferenceName == reference_name);

                if (item != null)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Get the tag definition's (whose handle equals <paramref name="tag_index"/>) name
        /// </summary>
        /// <param name="tag_datum">A tag index handle that references an existing datum in this cache instance</param>
        /// <param name="include_tag_group">True if the tag group should be appended to the result (ie, ".bitmap")</param>
        /// <returns>
        /// The path string linked to <paramref name="tag_index"/>'s tag definition, "empty" if the tag definition returns "IsEmpty",
        /// or null if retrieval fails
        /// </returns>
        public string GetTagIndexName(DatumIndex tag_datum, bool include_tag_group)
        {
            if (refManager == null || tag_datum == DatumIndex.Null)
            {
                return(null);
            }

            CacheIndex.Item i = Index.Tags[tag_datum.Index];

            if (i.IsEmpty)
            {
                return("<empty>");
            }

            string tag_name = refManager[i.ReferenceName];

            if (include_tag_group)
            {
                return(string.Format("{0}.{1}", tag_name, i.GroupTag.Name));
            }

            return(tag_name);
        }
Exemplo n.º 5
0
 public void Reset(CacheIndex.Item new_definition)
 {
     definition = new_definition;
     Database.SetRoot(definition);
 }