Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 public Index CreateIndex(string name, AttributeType attrType, AttributeCollationRule collRule)
 {
     Index.Create(attrType, collRule, this, name);
     return(GetIndex(name));
 }
Ejemplo n.º 8
0
 public Index CreateIndex(string name, AttributeType attrType, AttributeCollationRule collRule)
 {
     Index.Create(attrType, collRule, this, name);
     return GetIndex(name);
 }
Ejemplo n.º 9
0
        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();
        }