Example #1
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            RecordType = (CatalogRecordType)Utilities.ToInt16BigEndian(buffer, offset + 0);
            ParentId   = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            Name       = HfsPlusUtilities.ReadUniStr255(buffer, offset + 8);

            return(0);
        }
Example #2
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            RecordType = (CatalogRecordType)Utilities.ToInt16BigEndian(buffer, offset + 0);
            ParentId = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            Name = HfsPlusUtilities.ReadUniStr255(buffer, offset + 8);

            return 0;
        }
Example #3
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            this.RecordType = (CatalogRecordType)EndianUtilities.ToInt16BigEndian(buffer, offset + 0);
            this.ParentId   = EndianUtilities.ToUInt32BigEndian(buffer, offset + 4);
            this.Name       = HfsPlusUtilities.ReadUniStr255(buffer, offset + 8);

            return(this.Size);
        }
Example #4
0
        public virtual int ReadFrom(byte[] buffer, int offset)
        {
            RecordType = (CatalogRecordType)Utilities.ToInt16BigEndian(buffer, offset + 0);
            FileId = Utilities.ToUInt32BigEndian(buffer, offset + 8);
            CreateTime = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 12);
            ContentModifyTime = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 16);
            AttributeModifyTime = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 20);
            AccessTime = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 24);
            BackupTime = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 28);

            uint special;
            FileSystemInfo = HfsPlusUtilities.ReadBsdInfo(buffer, offset + 32, out special);
            UnixSpecialField = special;

            return 0;
        }
Example #5
0
        private static CommonCatalogFileInfo ParseDirEntryData(byte[] dirEntryData)
        {
            CatalogRecordType type = (CatalogRecordType)EndianUtilities.ToInt16BigEndian(dirEntryData, 0);

            CommonCatalogFileInfo result = null;

            switch (type)
            {
            case CatalogRecordType.FolderRecord:
                result = new CatalogDirInfo();
                break;

            case CatalogRecordType.FileRecord:
                result = new CatalogFileInfo();
                break;

            default:
                throw new NotImplementedException("Unknown catalog record type: " + type);
            }

            result.ReadFrom(dirEntryData, 0);
            return(result);
        }
Example #6
0
        internal static bool IsFileOrDirectory(byte[] dirEntryData)
        {
            CatalogRecordType type = (CatalogRecordType)EndianUtilities.ToInt16BigEndian(dirEntryData, 0);

            return(type == CatalogRecordType.FolderRecord || type == CatalogRecordType.FileRecord);
        }