コード例 #1
0
ファイル: ExtentKey.cs プロジェクト: ibeae/ThinkAway.net
 public ExtentKey(CatalogNodeId cnid, uint startBlock, bool resource_fork = false)
 {
     _keyLength  = 10;
     _nodeId     = cnid;
     _startBlock = startBlock;
     _forkType   = (byte)(resource_fork ? 0xff : 0x00);
 }
コード例 #2
0
        public override int ReadFrom(byte[] buffer, int offset)
        {
            _keyLength = Utilities.ToUInt16BigEndian(buffer, offset + 0);
            _nodeId    = new CatalogNodeId(Utilities.ToUInt32BigEndian(buffer, offset + 2));
            _name      = HfsPlusUtilities.ReadUniStr255(buffer, offset + 6);

            return(_keyLength + 2);
        }
コード例 #3
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;
        }
コード例 #4
0
ファイル: ExtentKey.cs プロジェクト: ibeae/ThinkAway.net
 public override int ReadFrom(byte[] buffer, int offset)
 {
     _keyLength  = Utilities.ToUInt16BigEndian(buffer, offset + 0);
     _forkType   = buffer[offset + 2];
     _nodeId     = new CatalogNodeId(Utilities.ToUInt32BigEndian(buffer, offset + 4));
     _startBlock = Utilities.ToUInt32BigEndian(buffer, offset + 8);
     return(_keyLength + 2);
 }
コード例 #5
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);
        }
コード例 #6
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;
        }
コード例 #7
0
ファイル: VolumeHeader.cs プロジェクト: ibeae/ThinkAway.net
        public int ReadFrom(byte[] buffer, int offset)
        {
            Signature          = Utilities.ToUInt16BigEndian(buffer, offset + 0);
            Version            = Utilities.ToUInt16BigEndian(buffer, offset + 2);
            Attributes         = (VolumeAttributes)Utilities.ToUInt32BigEndian(buffer, offset + 4);
            LastMountedVersion = Utilities.ToUInt32BigEndian(buffer, offset + 8);
            JournalInfoBlock   = Utilities.ToUInt32BigEndian(buffer, offset + 12);

            CreateDate  = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Local, buffer, offset + 16);
            ModifyDate  = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 20);
            BackupDate  = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 24);
            CheckedDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 28);

            FileCount   = Utilities.ToUInt32BigEndian(buffer, offset + 32);
            FolderCount = Utilities.ToUInt32BigEndian(buffer, offset + 36);

            BlockSize   = Utilities.ToUInt32BigEndian(buffer, offset + 40);
            TotalBlocks = Utilities.ToUInt32BigEndian(buffer, offset + 44);
            FreeBlocks  = Utilities.ToUInt32BigEndian(buffer, offset + 48);

            NextAllocation    = Utilities.ToUInt32BigEndian(buffer, offset + 52);
            ResourceClumpSize = Utilities.ToUInt32BigEndian(buffer, offset + 56);
            DataClumpSize     = Utilities.ToUInt32BigEndian(buffer, offset + 60);
            NextCatalogId     = new CatalogNodeId(Utilities.ToUInt32BigEndian(buffer, offset + 64));

            WriteCount      = Utilities.ToUInt32BigEndian(buffer, offset + 68);
            EncodingsBitmap = Utilities.ToUInt64BigEndian(buffer, offset + 72);

            FinderInfo = new uint[8];
            for (int i = 0; i < 8; ++i)
            {
                FinderInfo[i] = Utilities.ToUInt32BigEndian(buffer, offset + 80 + (i * 4));
            }

            AllocationFile = (ForkData)Utilities.ToStruct <ForkData>(buffer, offset + 112);
            ExtentsFile    = (ForkData)Utilities.ToStruct <ForkData>(buffer, offset + 192);
            CatalogFile    = (ForkData)Utilities.ToStruct <ForkData>(buffer, offset + 272);
            AttributesFile = (ForkData)Utilities.ToStruct <ForkData>(buffer, offset + 272);
            StartupFile    = (ForkData)Utilities.ToStruct <ForkData>(buffer, offset + 272);

            return(512);
        }
コード例 #8
0
 public FileBuffer(Context context, ForkData baseData, CatalogNodeId catalogNodeId)
 {
     _context  = context;
     _baseData = baseData;
     _cnid     = catalogNodeId;
 }
コード例 #9
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            Signature = Utilities.ToUInt16BigEndian(buffer, offset + 0);
            Version = Utilities.ToUInt16BigEndian(buffer, offset + 2);
            Attributes = (VolumeAttributes)Utilities.ToUInt32BigEndian(buffer, offset + 4);
            LastMountedVersion = Utilities.ToUInt32BigEndian(buffer, offset + 8);
            JournalInfoBlock = Utilities.ToUInt32BigEndian(buffer, offset + 12);

            CreateDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Local, buffer, offset + 16);
            ModifyDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 20);
            BackupDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 24);
            CheckedDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 28);

            FileCount = Utilities.ToUInt32BigEndian(buffer, offset + 32);
            FolderCount = Utilities.ToUInt32BigEndian(buffer, offset + 36);

            BlockSize = Utilities.ToUInt32BigEndian(buffer, offset + 40);
            TotalBlocks = Utilities.ToUInt32BigEndian(buffer, offset + 44);
            FreeBlocks = Utilities.ToUInt32BigEndian(buffer, offset + 48);

            NextAllocation = Utilities.ToUInt32BigEndian(buffer, offset + 52);
            ResourceClumpSize = Utilities.ToUInt32BigEndian(buffer, offset + 56);
            DataClumpSize = Utilities.ToUInt32BigEndian(buffer, offset + 60);
            NextCatalogId = new CatalogNodeId(Utilities.ToUInt32BigEndian(buffer, offset + 64));

            WriteCount = Utilities.ToUInt32BigEndian(buffer, offset + 68);
            EncodingsBitmap = Utilities.ToUInt64BigEndian(buffer, offset + 72);

            FinderInfo = new uint[8];
            for (int i = 0; i < 8; ++i)
            {
                FinderInfo[i] = Utilities.ToUInt32BigEndian(buffer, offset + 80 + (i * 4));
            }

            AllocationFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 112);
            ExtentsFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 192);
            CatalogFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272);
            AttributesFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272);
            StartupFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272);

            return 512;
        }
コード例 #10
0
ファイル: File.cs プロジェクト: marinehero/ThinkAway.net
 public File(Context context, CatalogNodeId nodeId, CommonCatalogFileInfo catalogInfo)
 {
     _context = context;
     _nodeId = nodeId;
     _catalogInfo = catalogInfo;
 }
コード例 #11
0
ファイル: Directory.cs プロジェクト: ibeae/ThinkAway.net
 public Directory(Context context, CatalogNodeId nodeId, CommonCatalogFileInfo fileInfo)
     : base(context, nodeId, fileInfo)
 {
 }
コード例 #12
0
 public File(Context context, CatalogNodeId nodeId, CommonCatalogFileInfo catalogInfo)
 {
     _context     = context;
     _nodeId      = nodeId;
     _catalogInfo = catalogInfo;
 }
コード例 #13
0
 public FileBuffer(Context context, ForkData baseData, CatalogNodeId catalogNodeId)
 {
     _context = context;
     _baseData = baseData;
     _cnid = catalogNodeId;
 }
コード例 #14
0
 public CatalogKey(CatalogNodeId nodeId, string name)
 {
     _nodeId = nodeId;
     _name   = name;
 }