public static void Create(AttributeType attrType, AttributeCollationRule collationRule, File file, string name) { Index idx = new Index(attrType, collationRule, file, name, file.Context.BiosParameterBlock, file.Context.UpperCase); idx.WriteRootNodeToDisk(); }
private Index(AttributeType attrType, AttributeCollationRule collationRule, File file, string name, BiosParameterBlock bpb, UpperCase upCase) { _file = file; _name = name; _bpb = bpb; IsFileIndex = name == "$I30"; _lock = new object(); _blockCache = new ObjectCache <long, IndexBlock>(); _file.CreateStream(AttributeType.IndexRoot, _name); _root = new IndexRoot { AttributeType = (uint)attrType, CollationRule = collationRule, IndexAllocationSize = (uint)bpb.IndexBufferSize, RawClustersPerIndexRecord = bpb.RawIndexBufferSize }; _comparer = _root.GetCollator(upCase); _rootNode = new IndexNode(WriteRootNodeToDisk, 0, this, true, 32); }
public int ReadFrom(byte[] buffer, int offset) { _attrType = Utilities.ToUInt32LittleEndian(buffer, 0x00); _collationRule = (AttributeCollationRule)Utilities.ToUInt32LittleEndian(buffer, 0x04); _indexAllocationEntrySize = Utilities.ToUInt32LittleEndian(buffer, 0x08); _rawClustersPerIndexRecord = buffer[0x0C]; return(16); }
internal void Read(byte[] buffer, int offset) { Name = Encoding.Unicode.GetString(buffer, offset + 0, 128).Trim('\0'); Type = (AttributeType)Utilities.ToUInt32LittleEndian(buffer, offset + 0x80); DisplayRule = Utilities.ToUInt32LittleEndian(buffer, offset + 0x84); CollationRule = (AttributeCollationRule)Utilities.ToUInt32LittleEndian(buffer, offset + 0x88); Flags = (AttributeTypeFlags)Utilities.ToUInt32LittleEndian(buffer, offset + 0x8C); MinSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x90); MaxSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x98); }
private Index(AttributeType attrType, AttributeCollationRule collationRule, File file, string name, BiosParameterBlock bpb, UpperCase upCase) { _file = file; _name = name; _bpb = bpb; _isFileIndex = name == "$I30"; _blockCache = new ObjectCache<long, IndexBlock>(); _file.CreateStream(AttributeType.IndexRoot, _name); _root = new IndexRoot() { AttributeType = (uint)attrType, CollationRule = collationRule, IndexAllocationSize = (uint)bpb.IndexBufferSize, RawClustersPerIndexRecord = bpb.RawIndexBufferSize }; _comparer = _root.GetCollator(upCase); _rootNode = new IndexNode(WriteRootNodeToDisk, 0, this, true, 32); }
public Index CreateIndex(string name, AttributeType attrType, AttributeCollationRule collRule) { Index.Create(attrType, collRule, this, name); return(GetIndex(name)); }
public Index CreateIndex(string name, AttributeType attrType, AttributeCollationRule collRule) { Index.Create(attrType, collRule, this, name); return GetIndex(name); }