Exemple #1
0
        /// <summary>
        /// Read Collection page from ByteReader
        /// </summary>
        private CollectionPage_v6 ReadCollectionPage(ByteReader reader)
        {
            var page = new CollectionPage_v6 {
                Indexes = new Dictionary <string, bool>()
            };

            page.CollectionName = reader.ReadString();
            reader.ReadUInt32();                      // FreeDataPageID
            page.DocumentCount = reader.ReadUInt32();
            reader.ReadString();                      // _id
            page.HeadNode = reader.ReadPageAddress(); // _id headnode
            reader.Skip(15);                          // all index info from _id headnode

            for (var i = 1; i < 15; i++)
            {
                var field = reader.ReadString();
                reader.Skip(16); // HeadNode + TailNode + FreeIndexPageID
                var unique = reader.ReadBoolean();
                reader.Skip(4);  // IgnoreCase + TrimWhitespace + EmptyStringToNull + RemoveAccents

                if (!string.IsNullOrEmpty(field))
                {
                    page.Indexes.Add(field, unique);
                }
            }

            return(page);
        }
Exemple #2
0
        /// <summary>
        /// Read Collection page from ByteReader
        /// </summary>
        private CollectionPage_v6 ReadCollectionPage(ByteReader reader)
        {
            var page = new CollectionPage_v6();

            page.CollectionName = reader.ReadString();
            page.DocumentCount  = reader.ReadInt64();
            reader.ReadUInt32(); // FreeDataPageID

            page.Indexes = new Dictionary <string, bool>();


            return(page);
        }