Ejemplo n.º 1
0
 internal BuildFileInfo(string name, BuildDirectoryInfo parent, Stream source)
     : base(IsoUtilities.NormalizeFileName(name), MakeShortFileName(name, parent))
 {
     _parent        = parent;
     _contentStream = source;
     _contentSize   = _contentStream.Length;
 }
Ejemplo n.º 2
0
 internal BuildFileInfo(string name, BuildDirectoryInfo parent, byte[] content)
     : base(IsoUtilities.NormalizeFileName(name), MakeShortFileName(name, parent))
 {
     _parent      = parent;
     _contentData = content;
     _contentSize = content.LongLength;
 }
Ejemplo n.º 3
0
        public ReaderDirEntry GetEntryByName(string name)
        {
            bool   anyVerMatch = name.IndexOf(';') < 0;
            string normName    = IsoUtilities.NormalizeFileName(name).ToUpper(CultureInfo.InvariantCulture);

            if (anyVerMatch)
            {
                normName = normName.Substring(0, normName.LastIndexOf(';') + 1);
            }

            foreach (ReaderDirEntry r in _records)
            {
                string toComp = IsoUtilities.NormalizeFileName(r.FileName).ToUpper(CultureInfo.InvariantCulture);
                if (!anyVerMatch && toComp == normName)
                {
                    return(r);
                }
                if (anyVerMatch && toComp.StartsWith(normName, StringComparison.Ordinal))
                {
                    return(r);
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
 internal BuildFileInfo(string name, BuildDirectoryInfo parent, string content)
     : base(IsoUtilities.NormalizeFileName(name), MakeShortFileName(name, parent))
 {
     _parent      = parent;
     _contentPath = content;
     _contentSize = new FileInfo(_contentPath).Length;
 }
Ejemplo n.º 5
0
        public IEnumerable <ReaderDirEntry> GetEntriesByName(string name)
        {
            // It's possible that this file has multiple extents. Get them all
            bool   anyVerMatch = name.IndexOf(';') < 0;
            string normName    = IsoUtilities.NormalizeFileName(name).ToUpper(CultureInfo.InvariantCulture);

            if (anyVerMatch)
            {
                normName = normName.Substring(0, normName.LastIndexOf(';') + 1);
            }

            foreach (ReaderDirEntry r in _records)
            {
                string toComp = IsoUtilities.NormalizeFileName(r.FileName).ToUpper(CultureInfo.InvariantCulture);
                if (!anyVerMatch && toComp == normName)
                {
                    yield return(r);
                }
                else if (anyVerMatch && toComp.StartsWith(normName, StringComparison.Ordinal))
                {
                    yield return(r);
                }
            }
        }