Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Tagged as

Go to top

Building an embedded database engine in C#

, 10 Jun 2009
DbfDotNet is a very fast and compact fully managed standalone database/entity framework, for the .Net Framework.
using System;
using System.Collections.Generic;
using System.Text;

namespace DbfDotNet.Core
{
#pragma warning disable 649

    [Record(FieldMapping = FieldMapping.ExplicitColumnsOnly, Width = 32)]
    internal class NdxHeader 
    {
        [Column(Type = ColumnType.UINT32)]
        private UInt32 mNativeNdxStartingPageRecordNo; //0..3

        public UInt32 StartingPageRecordNo
        {
            get { return mNativeNdxStartingPageRecordNo - 1; }
            set { mNativeNdxStartingPageRecordNo = value + 1; }
        }


        [Column(Type = ColumnType.UINT32)]
        public UInt32 TotalNoOfPages; //4..7

        [Column(Type = ColumnType.UINT32)]
        public UInt32 Zero; //8..11

        [Column(Type = ColumnType.UINT16)]
        public UInt16 KeyLength; //12..13


        [Column(Type = ColumnType.UINT16)]
        public UInt16 NoOfKeysPerPage; // 14..15

        [Column(Type = ColumnType.UINT16)]
        public UInt16 KeyType; // 16..17 - 0 = char; 1 = num

        [Column(Type = ColumnType.UINT32)]
        public UInt32 SizeOfKeyRecord; // 18..21

        [Column(Type = ColumnType.BYTE)]
        public Byte Reserved; // 22

        [Column(Type = ColumnType.BOOL)]
        public bool UniqueFlag; // 23

        [Column(Type = ColumnType.CHARACTER, Width = 255)] // 
        public string KeyString1; // 24..

        [Column(Type = ColumnType.CHARACTER, Width = 233)] // 512 - 255 - 24
        public string KeyString2;
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Pascal Ganaye
Software Developer (Senior)
United Kingdom United Kingdom
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 10 Jun 2009
Article Copyright 2009 by Pascal Ganaye
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid