GetAttribute() public method

public GetAttribute ( AttributeType type ) : MFTAttribute
type AttributeType
return MFTAttribute
示例#1
0
        public FolderNTFS(MFTRecord record, string path, bool isRoot = false)
        {
            _record    = record;
            FileSystem = record.FileSystem;
            Deleted    = _record.Deleted;
            _indexRoot = new NTFSFileStream(_record.PartitionStream, _record, AttributeType.IndexRoot);

            MFTAttribute attr = _record.GetAttribute(AttributeType.IndexAllocation);

            if (attr != null)
            {
                _indexAllocation = new NTFSFileStream(_record.PartitionStream, _record, AttributeType.IndexAllocation);
            }
            if (isRoot)               // root
            {
                Root = true;
                Name = FileSystem.Store.DeviceID;
                Path = FileSystem.Store.DeviceID;
                foreach (FileSystemNode node in GetChildren("$Volume"))
                {
                    FileNTFS file = node as FileNTFS;
                    if (file != null && file.VolumeLabel != "")
                    {
                        Name = file.VolumeLabel;
                        break;
                    }
                }
            }
            else
            {
                Name = PathUtils.MakeFileNameValid(record.FileName);
                if (!string.IsNullOrEmpty(path))
                {
                    Path = PathUtils.Combine(path, Name);
                }
                else
                {
                    // We don't know the path
                    Path = PathUtils.Combine(FileSystem.Store.DeviceID, "?", Name);
                }
            }
        }
		public FolderNTFS(MFTRecord record, string path, bool isRoot = false) {
			_record = record;
			FileSystem = record.FileSystem;
			Deleted = _record.Deleted;
			_indexRoot = new NTFSFileStream(_record.PartitionStream, _record, AttributeType.IndexRoot);

			MFTAttribute attr = _record.GetAttribute(AttributeType.IndexAllocation);
			if (attr != null) {
				_indexAllocation = new NTFSFileStream(_record.PartitionStream, _record, AttributeType.IndexAllocation);
			}
			if (isRoot) { // root
				Root = true;
				Name = FileSystem.Store.DeviceID;
				Path = FileSystem.Store.DeviceID;
				foreach (FileSystemNode node in GetChildren("$Volume")) {
					FileNTFS file = node as FileNTFS;
					if (file != null && file.VolumeLabel != "") {
						Name = file.VolumeLabel;
						break;
					}
				}
			} else {
				Name = record.FileName;
				if (!string.IsNullOrEmpty(path)) {
					Path = PathUtils.Combine(path, Name);
				} else {
					// We don't know the path
					Path = PathUtils.Combine(FileSystem.Store.DeviceID, "?", Name);
				}
			}
		}
示例#3
0
 public NTFSFileStream(IDataStream partition, MFTRecord record, AttributeType attrType) :
     this(partition, record, record.GetAttribute(attrType))
 {
 }
		public NTFSFileStream(IDataStream partition, MFTRecord record, AttributeType attrType) :
			this(partition, record, record.GetAttribute(attrType)) { }