亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mitab_indfile.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        CPLError(CE_Failure, CPLE_AssertionFailed,
                 "TABINDNode::Search(): Node has not been initialized yet!");
        return -1;
    }

    /*-----------------------------------------------------------------
     * m_nCurIndexEntry is the index of the last item that has been 
     * returned by FindFirst()/FindNext().
     *----------------------------------------------------------------*/

    if (m_nSubTreeDepth == 1)
    {
        /*-------------------------------------------------------------
         * Leaf node level... check if the next entry is an exact match
         *------------------------------------------------------------*/
        m_nCurIndexEntry++;
        if (m_nCurIndexEntry >= m_numEntriesInNode && m_nNextNodePtr > 0)
        {
            // We're at the end of a node ... continue with next node
            GotoNodePtr(m_nNextNodePtr);
            m_nCurIndexEntry = 0;
        }

        if (m_nCurIndexEntry < m_numEntriesInNode &&
            IndexKeyCmp(pKeyValue, m_nCurIndexEntry) == 0)
        {
           /* Found it!  Return the record number */
            return ReadIndexEntry(m_nCurIndexEntry, NULL);
        }
        else
        {
            /* No more items with that key... return 0 */
            return 0;
        }
    }
    else
    {
        /*-------------------------------------------------------------
         * Index Node: just pass the search to this child node.
         *------------------------------------------------------------*/
        while(m_nCurIndexEntry < m_numEntriesInNode)
        {
            if (m_poCurChildNode != NULL)
                return m_poCurChildNode->FindNext(pKeyValue);
        }
    }

    // No more nodes were found that contain the key value.
    return 0;
}


/**********************************************************************
 *                   TABINDNode::CommitToFile()
 *
 * For write access, write current block and its children to file.
 *
 * note: TABRawBinBlock::CommitToFile() does nothing unless the block has
 *       been modified.  (it has an internal bModified flag)
 *
 * Returns 0 on success, -1 on error.
 **********************************************************************/
int TABINDNode::CommitToFile()
{
    if ((m_eAccessMode != TABWrite && m_eAccessMode != TABReadWrite) || 
        m_poDataBlock == NULL)
        return -1;

    if (m_poCurChildNode)
    {
        if (m_poCurChildNode->CommitToFile() != 0)
            return -1;

        m_nSubTreeDepth = m_poCurChildNode->GetSubTreeDepth() + 1;
    }

    return m_poDataBlock->CommitToFile();
}

/**********************************************************************
 *                   TABINDNode::AddEntry()
 *
 * Add an .DAT record entry for pKeyValue in this index
 *
 * nRecordNo is the .DAT record number, record numbers start at 1.
 *
 * In order to insert a new value, the root node first does a FindFirst()
 * that will load the whole tree branch up to the insertion point.
 * Then AddEntry() is recursively called up to the leaf node level for
 * the insertion of the actual value.
 * If the leaf node is full then it will be split and if necessary the 
 * split will propagate up in the tree through the pointer that each node
 * has on its parent.
 *
 * If bAddInThisNodeOnly=TRUE, then the entry is added only locally and
 * we do not try to update the child node.  This is used when the parent 
 * of a node that is being splitted has to be updated.
 *
 * bInsertAfterCurChild forces the insertion to happen immediately after
 * the m_nCurIndexEntry.  This works only when bAddInThisNodeOnly=TRUE.
 * The default is to search the node for a an insertion point.
 *
 * Returns 0 on success, -1 on error
 **********************************************************************/
int TABINDNode::AddEntry(GByte *pKeyValue, GInt32 nRecordNo,
                         GBool bAddInThisNodeOnly /*=FALSE*/,
                         GBool bInsertAfterCurChild /*=FALSE*/,
                         GBool bMakeNewEntryCurChild /*=FALSE*/)
{
    if ((m_eAccessMode != TABWrite && m_eAccessMode != TABReadWrite) || 
        m_poDataBlock == NULL)
        return -1;

    /*-----------------------------------------------------------------
     * If I'm the root node, then do a FindFirst() to init all the nodes
     * and to make all of them point ot the insertion point.
     *----------------------------------------------------------------*/
    if (m_poParentNodeRef == NULL && !bAddInThisNodeOnly)
    {
        if (FindFirst(pKeyValue) < 0)
            return -1;  // Error happened and has already been reported.
    }

    if (m_poCurChildNode && !bAddInThisNodeOnly)
    {
        CPLAssert(m_nSubTreeDepth > 1);
        /*-------------------------------------------------------------
         * Propagate the call down to our children
         * Note: this recursive call could result in new levels of nodes
         * being added under our feet by SplitRootnode() so it is very 
         * important to return right after this call or we might not be 
         * able to recognize this node at the end of the call!
         *------------------------------------------------------------*/
        return m_poCurChildNode->AddEntry(pKeyValue, nRecordNo);
    }
    else
    {
        /*-------------------------------------------------------------
         * OK, we're a leaf node... this is where the real work happens!!!
         *------------------------------------------------------------*/
        CPLAssert(m_nSubTreeDepth == 1 || bAddInThisNodeOnly);

        /*-------------------------------------------------------------
         * First thing to do is make sure that there is room for a new
         * entry in this node, and to split it if necessary.
         *------------------------------------------------------------*/
        if (GetNumEntries() == GetMaxNumEntries())
        {
            if (m_poParentNodeRef == NULL)
            {
                /*-----------------------------------------------------
                 * Splitting the root node adds one level to the tree, so
                 * after splitting we just redirect the call to our child.
                 *----------------------------------------------------*/
                if (SplitRootNode() != 0)
                    return -1;  // Error happened and has already been reported

                CPLAssert(m_poCurChildNode);
                CPLAssert(m_nSubTreeDepth > 1);
                return m_poCurChildNode->AddEntry(pKeyValue, nRecordNo,
                                                  bAddInThisNodeOnly,
                                                  bInsertAfterCurChild,
                                                  bMakeNewEntryCurChild);
            }
            else
            {
                /*-----------------------------------------------------
                 * Splitting a regular node will leave it 50% full.
                 *----------------------------------------------------*/
                if (SplitNode() != 0)
                    return -1; 
            }
        }

        /*-------------------------------------------------------------
         * Insert new key/value at the right position in node.
         *------------------------------------------------------------*/
        if (InsertEntry(pKeyValue, nRecordNo, 
                        bInsertAfterCurChild, bMakeNewEntryCurChild) != 0)
            return -1;
    }

    return 0;
}

/**********************************************************************
 *                   TABINDNode::InsertEntry()
 *
 * (private method)
 *
 * Insert a key/value pair in the current node buffer.
 *
 * Returns 0 on success, -1 on error
 **********************************************************************/
int TABINDNode::InsertEntry(GByte *pKeyValue, GInt32 nRecordNo,
                            GBool bInsertAfterCurChild /*=FALSE*/,
                            GBool bMakeNewEntryCurChild /*=FALSE*/)
{
    int iInsertAt=0;

    if (GetNumEntries() >= GetMaxNumEntries())
    {   
        CPLError(CE_Failure, CPLE_AssertionFailed,
                 "Node is full!  Cannot insert key!");
        return -1;
    }

    /*-----------------------------------------------------------------
     * Find the spot where the key belongs
     *----------------------------------------------------------------*/
    if (bInsertAfterCurChild)
    {
        iInsertAt = m_nCurIndexEntry+1;
    }
    else
    {
        while(iInsertAt < m_numEntriesInNode)
        {
            int nCmpStatus = IndexKeyCmp(pKeyValue, iInsertAt);
            if (nCmpStatus <= 0)
            {
                break;
            }
            iInsertAt++;
        }
    }

    m_poDataBlock->GotoByteInBlock(12 + iInsertAt*(m_nKeyLength+4));

    /*-----------------------------------------------------------------
     * Shift all entries that follow in the array
     *----------------------------------------------------------------*/
    if (iInsertAt < m_numEntriesInNode)
    {
        // Since we use memmove() directly, we need to inform 
        // m_poDataBlock that the upper limit of the buffer will move
        m_poDataBlock->GotoByteInBlock(12 + (m_numEntriesInNode+1)*
                                                        (m_nKeyLength+4));
        m_poDataBlock->GotoByteInBlock(12 + iInsertAt*(m_nKeyLength+4));

        memmove(m_poDataBlock->GetCurDataPtr()+(m_nKeyLength+4),
                m_poDataBlock->GetCurDataPtr(),
                (m_numEntriesInNode-iInsertAt)*(m_nKeyLength+4));

    }

    /*-----------------------------------------------------------------
     * Write new entry
     *----------------------------------------------------------------*/
    m_poDataBlock->WriteBytes(m_nKeyLength, pKeyValue);
    m_poDataBlock->WriteInt32(nRecordNo);

    m_numEntriesInNode++;
    m_poDataBlock->GotoByteInBlock(0);
    m_poDataBlock->WriteInt32(m_numEntriesInNode);

    if (bMakeNewEntryCurChild)
        m_nCurIndexEntry = iInsertAt;
    else if (m_nCurIndexEntry >= iInsertAt)
        m_nCurIndexEntry++;

    /*-----------------------------------------------------------------
     * If we replaced the first entry in the node, then this node's key
     * changes and we have to update the reference in the parent node.
     *----------------------------------------------------------------*/
    if (iInsertAt == 0 && m_poParentNodeRef)
    {
        if (m_poParentNodeRef->UpdateCurChildEntry(GetNodeKey(),
                                                   GetNodeBlockPtr()) != 0)
            return -1;
    }

    return 0;
}


/**********************************************************************
 *                   TABINDNode::UpdateCurChildEntry()
 *
 * Update the key for the current child node.  This method is called by
 * the child when its first entry (defining its node key) is changed.
 *
 * Returns 0 on success, -1 on error
 **********************************************************************/
int TABINDNode::UpdateCurChildEntry(GByte *pKeyValue, GInt32 nRecordNo)
{

    /*-----------------------------------------------------------------
     * Update current child entry with the info for the first node.
     *
     * For some reason, the key for first entry of the first node of each
     * level has to be set to 0 except for the leaf level.
     *----------------------------------------------------------------*/
    m_poDataBlock->GotoByteInBlock(12 + m_nCurIndexEntry*(m_nKeyLength+4));

    if (m_nCurIndexEntry == 0 && m_nSubTreeDepth > 1 && m_nPrevNodePtr == 0)
    {
        m_poDataBlock->WriteZeros(m_nKeyLength);
    }
    else
    {
        m_poDataBlock->WriteBytes(m_nKeyLength, pKeyValue);
    }
    m_poDataBlock->WriteInt32(nRecordNo);

    return 0;
}



/**********************************************************************
 *                   TABINDNode::UpdateSplitChild()
 *
 * Update the key and/or record ptr information corresponding to the 
 * current child node.
 *
 * Returns 0 on success, -1 on error
 **********************************************************************/
int TABINDNode::UpdateSplitChild(GByte *pKeyValue1, GInt32 nRecordNo1,
                                 GByte *pKeyValue2, GInt32 nRecordNo2,
                                 int nNewCurChildNo /* 1 or 2 */)
{

    /*-----------------------------------------------------------------
     * Update current child entry with the info for the first node.
     *
     * For some reason, the key for first entry of the first node of each
     * level has to be set to 0 except for the leaf level.
     *----------------------------------------------------------------*/
    m_poDataBlock->GotoByteInBlock(12 + m_nCurIndexEntry*(m_nKeyLength+4));

    if (m_nCurIndexEntry == 0 && m_nSubTreeDepth > 1 && m_nPrevNodePtr == 0)
    {
        m_poDataBlock->WriteZeros(m_nKeyLength);
    }
    else
    {
        m_poDataBlock->WriteBytes(m_

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲中文字幕精品| 亚洲永久免费av| 日本精品一区二区三区高清| 视频一区二区中文字幕| 欧美激情一区二区在线| 777奇米成人网| 色综合咪咪久久| 国产盗摄一区二区三区| 亚洲va天堂va国产va久| 中文字幕一区二区三| 日韩精品一区二区三区swag | 国产午夜精品一区二区三区四区| 一本久久综合亚洲鲁鲁五月天| 精品一区二区三区不卡| 性做久久久久久久久| 亚洲美女视频在线观看| 亚洲国产经典视频| 久久久久亚洲综合| 欧美精品一区二区在线播放| 欧美一区二区三区四区五区| 91久久香蕉国产日韩欧美9色| 懂色一区二区三区免费观看| 国产自产视频一区二区三区| 免费黄网站欧美| 天天综合天天做天天综合| 玉足女爽爽91| 一区二区在线观看免费| 日韩毛片视频在线看| 国产精品天美传媒| 国产欧美中文在线| 久久人人爽人人爽| 久久久久久亚洲综合影院红桃| 精品久久国产字幕高潮| 日韩天堂在线观看| 日韩色在线观看| 欧美一二区视频| 日韩免费观看高清完整版| 欧美一区二区不卡视频| 91精品国产高清一区二区三区| 制服丝袜激情欧洲亚洲| 91麻豆精品91久久久久久清纯| 欧美日韩aaaaaa| 欧美一卡在线观看| 日韩一区二区影院| 久久久久久久综合狠狠综合| 久久精品视频网| 国产精品免费丝袜| 亚洲女爱视频在线| 不卡的电影网站| 91丨porny丨户外露出| 99久久精品免费看国产免费软件| www.欧美精品一二区| 97se亚洲国产综合自在线不卡 | 老司机精品视频导航| 久久电影网电视剧免费观看| 久久精品久久99精品久久| 黄页网站大全一区二区| 国产成人午夜精品5599| 99国产精品99久久久久久| 欧美亚洲一区二区三区四区| 欧美高清www午色夜在线视频| 欧美一级黄色大片| 国产日韩欧美高清| 亚洲天堂2016| 欧美视频三区在线播放| www.性欧美| 国产精品白丝jk白祙喷水网站| 日本vs亚洲vs韩国一区三区二区| 亚洲一区二区视频| 亚洲综合丝袜美腿| 亚洲黄色小说网站| 亚洲第一福利一区| 青青国产91久久久久久 | 色天使久久综合网天天| av电影在线观看不卡| 成人avav影音| 欧美日韩精品三区| 日韩亚洲欧美一区二区三区| 日韩精品一区二区三区中文精品| 亚洲视频中文字幕| 亚洲人成亚洲人成在线观看图片| 成人欧美一区二区三区1314| 久草精品在线观看| 欧美综合久久久| 91成人在线免费观看| 欧美中文一区二区三区| 成人一区二区视频| 色噜噜狠狠一区二区三区果冻| 欧美日韩黄色影视| 久久福利资源站| 国产午夜一区二区三区| 欧美精品在欧美一区二区少妇| 成人免费三级在线| 欧美一区二区三区男人的天堂| 亚洲国产精品激情在线观看| 天堂精品中文字幕在线| 成人午夜伦理影院| 日韩免费在线观看| 亚洲国产日韩在线一区模特| 国产传媒一区在线| 欧美一区在线视频| 亚洲狠狠丁香婷婷综合久久久| 国产在线播放一区三区四| 欧美乱妇20p| 一区二区三区四区在线播放 | 国内外成人在线视频| 欧美日韩亚洲不卡| √…a在线天堂一区| 国产一区二区导航在线播放| 这里只有精品视频在线观看| 一二三四区精品视频| 99vv1com这只有精品| 国产色产综合色产在线视频| 老司机精品视频线观看86 | 欧美日韩另类国产亚洲欧美一级| 国产嫩草影院久久久久| 久久99精品一区二区三区 | 欧美嫩在线观看| 亚洲午夜精品17c| 大尺度一区二区| 欧美电视剧免费观看| 亚洲猫色日本管| 91影视在线播放| 日本一二三四高清不卡| 激情都市一区二区| 久久婷婷一区二区三区| 日韩福利电影在线| 欧美私模裸体表演在线观看| 国产精品无人区| 成人av资源在线| 国产亚洲女人久久久久毛片| 日韩成人一区二区| 欧美精品一二三区| 一区二区在线观看视频| 成人精品视频.| 欧美精彩视频一区二区三区| 开心九九激情九九欧美日韩精美视频电影 | 久久久精品免费观看| 日韩国产欧美在线视频| 欧美日韩色一区| 亚洲成人激情av| 欧美午夜片在线观看| 亚洲一区二区三区四区五区黄| 色综合视频一区二区三区高清| 国产精品国产三级国产| 成人性色生活片| 国产亲近乱来精品视频| 99久久99久久精品免费观看| 国产精品一区专区| 精品国产髙清在线看国产毛片| 日韩av电影天堂| 欧美一区二区黄| 国产精品一区二区x88av| 久久女同精品一区二区| 国产精品996| 国产精品久久毛片av大全日韩| 国产精品一区二区91| 国产女人aaa级久久久级| 国产精品77777| 国产精品无遮挡| 色婷婷综合久色| 免费看日韩精品| 26uuu精品一区二区| 国产在线日韩欧美| 国产资源精品在线观看| 亚洲女性喷水在线观看一区| 欧美一二三区精品| 色欧美乱欧美15图片| 国产精品一二三在| 日产欧产美韩系列久久99| 亚洲综合av网| 亚洲永久精品国产| 国产精品护士白丝一区av| 久久人人97超碰com| 日韩视频国产视频| av中文字幕在线不卡| 免费欧美在线视频| 美腿丝袜亚洲综合| 亚洲欧美色一区| 最新高清无码专区| 亚洲色图第一区| 国产精品久久久久四虎| 国产精品区一区二区三| 久久久国产综合精品女国产盗摄| 日韩欧美国产综合在线一区二区三区| 在线观看91av| 粉嫩aⅴ一区二区三区四区五区| 福利视频网站一区二区三区| 日本久久一区二区| av综合在线播放| 色婷婷av一区二区三区软件 | 欧美综合一区二区| 久久久美女艺术照精彩视频福利播放| 中文字幕在线播放不卡一区| 在线观看成人小视频| 午夜天堂影视香蕉久久| 欧美高清在线精品一区| 日韩毛片一二三区| 欧美高清一级片在线| 国产成人自拍在线|