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

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

?? mitab_tabview.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/**********************************************************************
 * $Id: mitab_tabview.cpp,v 1.18 2008/01/29 20:46:32 dmorissette Exp $
 *
 * Name:     mitab_tabfile.cpp
 * Project:  MapInfo TAB Read/Write library
 * Language: C++
 * Purpose:  Implementation of the TABView class, used to handle .TAB
 *           datasets composed of a number of .TAB files linked through 
 *           indexed fields.
 * Author:   Daniel Morissette, dmorissette@dmsolutions.ca
 *
 **********************************************************************
 * Copyright (c) 1999-2002, Daniel Morissette
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 * DEALINGS IN THE SOFTWARE.
 **********************************************************************
 *
 * $Log: mitab_tabview.cpp,v $
 * Revision 1.18  2008/01/29 20:46:32  dmorissette
 * Added support for v9 Time and DateTime fields (byg 1754)
 *
 * Revision 1.17  2007/06/21 14:00:23  dmorissette
 * Added missing cast in isspace() calls to avoid failed assertion on Windows
 * (MITAB bug 1737, GDAL ticket 1678))
 *
 * Revision 1.16  2007/06/12 13:52:38  dmorissette
 * Added IMapInfoFile::SetCharset() method (bug 1734)
 *
 * Revision 1.15  2007/06/12 12:50:40  dmorissette
 * Use Quick Spatial Index by default until bug 1732 is fixed (broken files
 * produced by current coord block splitting technique).
 *
 * Revision 1.14  2007/03/21 21:15:56  dmorissette
 * Added SetQuickSpatialIndexMode() which generates a non-optimal spatial
 * index but results in faster write time (bug 1669)
 *
 * Revision 1.13  2004/06/30 20:29:04  dmorissette
 * Fixed refs to old address danmo@videotron.ca
 *
 * Revision 1.12  2002/02/22 20:44:51  julien
 * Prevent infinite loop with TABRelation by suppress the m_poCurFeature object
 * from the class and setting it in the calling function and add GetFeature in
 * the class. (bug 706)
 *
 * Revision 1.11  2002/01/10 05:13:22  daniel
 * Prevent crash if .IND file is deleted (but 703)
 *
 * Revision 1.10  2002/01/10 04:52:58  daniel
 * Support 'select * ...' syntax + 'open table..." directives with/without .tab
 *
 * Revision 1.9  2001/06/27 19:52:26  warmerda
 * use VSIUnlink() instead of unlink()
 *
 * Revision 1.8  2001/03/15 03:57:51  daniel
 * Added implementation for new OGRLayer::GetExtent(), returning data MBR.
 *
 * Revision 1.7  2000/09/28 16:39:44  warmerda
 * avoid warnings for unused, and unitialized variables
 *
 * Revision 1.6  2000/02/28 17:12:22  daniel
 * Write support for joined tables and indexed fields
 *
 * Revision 1.5  2000/01/15 22:30:45  daniel
 * Switch to MIT/X-Consortium OpenSource license
 *
 * Revision 1.4  1999/12/19 17:40:16  daniel
 * Init + delete m_poRelation properly
 *
 * Revision 1.3  1999/12/14 05:53:00  daniel
 * Fixed compile warnings
 *
 * Revision 1.2  1999/12/14 04:04:10  daniel
 * Added bforceFlags to GetBounds() and GetFeatureCountByType()
 *
 * Revision 1.1  1999/12/14 02:10:32  daniel
 * Initial revision
 *
 **********************************************************************/

#include "mitab.h"
#include "mitab_utils.h"

#include <ctype.h>      /* isspace() */

/*=====================================================================
 *                      class TABView
 *====================================================================*/


/**********************************************************************
 *                   TABView::TABView()
 *
 * Constructor.
 **********************************************************************/
TABView::TABView()
{
    m_pszFname = NULL;
    m_eAccessMode = TABRead;
    m_papszTABFile = NULL;
    m_pszVersion = NULL;

    m_numTABFiles = 0;
    m_papszTABFnames = NULL;
    m_papoTABFiles = NULL;
    m_nMainTableIndex = -1;

    m_papszFieldNames = NULL;
    m_papszWhereClause = NULL;

    m_poRelation = NULL;
    m_bRelFieldsCreated = FALSE;
}

/**********************************************************************
 *                   TABView::~TABView()
 *
 * Destructor.
 **********************************************************************/
TABView::~TABView()
{
    Close();
}


int TABView::GetFeatureCount (int bForce)
{

    if (m_nMainTableIndex != -1)
        return m_papoTABFiles[m_nMainTableIndex]->GetFeatureCount( bForce );

    return 0;
}

void TABView::ResetReading()
{
    if (m_nMainTableIndex != -1)
        m_papoTABFiles[m_nMainTableIndex]->ResetReading();
}


/**********************************************************************
 *                   TABView::Open()
 *
 * Open a .TAB dataset and the associated files, and initialize the 
 * structures to be ready to read features from it.
 *
 * This class is used to open .TAB files that define a view on
 * two other .TAB files.  Regular .TAB datasets should be opened using
 * the TABFile class instead.
 *
 * Set bTestOpenNoError=TRUE to silently return -1 with no error message
 * if the file cannot be opened.  This is intended to be used in the
 * context of a TestOpen() function.  The default value is FALSE which
 * means that an error is reported if the file cannot be opened.
 *
 * Returns 0 on success, -1 on error.
 **********************************************************************/
int TABView::Open(const char *pszFname, const char *pszAccess,
                  GBool bTestOpenNoError /*= FALSE*/ )
{
    char nStatus = 0;
   
    if (m_numTABFiles > 0)
    {
        CPLError(CE_Failure, CPLE_AssertionFailed,
                 "Open() failed: object already contains an open file");
        return -1;
    }

    /*-----------------------------------------------------------------
     * Validate access mode and call the right open method
     *----------------------------------------------------------------*/
    if (EQUALN(pszAccess, "r", 1))
    {
        m_eAccessMode = TABRead;
        nStatus = OpenForRead(pszFname, bTestOpenNoError);
    }
    else if (EQUALN(pszAccess, "w", 1))
    {
        m_eAccessMode = TABWrite;
        nStatus = OpenForWrite(pszFname);
    }
    else
    {
        CPLError(CE_Failure, CPLE_NotSupported,
                 "Open() failed: access mode \"%s\" not supported", pszAccess);
        return -1;
    }

    return nStatus;
}


/**********************************************************************
 *                   TABView::OpenForRead()
 *
 * Open for reading
 *
 * Returns 0 on success, -1 on error.
 **********************************************************************/
int TABView::OpenForRead(const char *pszFname, 
                         GBool bTestOpenNoError /*= FALSE*/ )
{
    char *pszPath = NULL;
    int nFnameLen = 0;
   
    m_eAccessMode = TABRead;

    /*-----------------------------------------------------------------
     * Read main .TAB (text) file
     *----------------------------------------------------------------*/
    m_pszFname = CPLStrdup(pszFname);

#ifndef _WIN32
    /*-----------------------------------------------------------------
     * On Unix, make sure extension uses the right cases
     * We do it even for write access because if a file with the same
     * extension already exists we want to overwrite it.
     *----------------------------------------------------------------*/
    TABAdjustFilenameExtension(m_pszFname);
#endif

    /*-----------------------------------------------------------------
     * Open .TAB file... since it's a small text file, we will just load
     * it as a stringlist in memory.
     *----------------------------------------------------------------*/
    m_papszTABFile = TAB_CSLLoad(m_pszFname);
    if (m_papszTABFile == NULL)
    {
        if (!bTestOpenNoError)
        {
            CPLError(CE_Failure, CPLE_FileIO,
                     "Failed opening %s.", m_pszFname);
        }
        
        CPLFree(m_pszFname);
        return -1;
    }

    /*-------------------------------------------------------------
     * Look for a line with the "create view" keyword.
     * If there is no "create view", then we may have a valid .TAB file,
     * but we do not support it in this class.
     *------------------------------------------------------------*/
    GBool bCreateViewFound = FALSE;
    for (int i=0; 
         !bCreateViewFound && m_papszTABFile && m_papszTABFile[i];
         i++)
    {
        const char *pszStr = m_papszTABFile[i];
        while(*pszStr != '\0' && isspace((unsigned char)*pszStr))
            pszStr++;
        if (EQUALN(pszStr, "create view", 11))
            bCreateViewFound = TRUE;
    }

    if ( !bCreateViewFound )
    {
        if (!bTestOpenNoError)
            CPLError(CE_Failure, CPLE_NotSupported,
                     "%s contains no table view definition.  "
                     "This type of .TAB file cannot be read by this library.",
                     m_pszFname);
        else
            CPLErrorReset();

        CPLFree(m_pszFname);

        return -1;
    }

    /*-----------------------------------------------------------------
     * OK, this appears to be a valid TAB view dataset...
     * Extract the path component from the main .TAB filename
     * to build the filename of the sub-tables
     *----------------------------------------------------------------*/
    pszPath = CPLStrdup(m_pszFname);
    nFnameLen = strlen(pszPath);
    for( ; nFnameLen > 0; nFnameLen--)
    {
        if (pszPath[nFnameLen-1] == '/' || 
            pszPath[nFnameLen-1] == '\\' )
        {
            break;
        }
        pszPath[nFnameLen-1] = '\0';
    }

    /*-----------------------------------------------------------------
     * Extract the useful info from the TAB header
     *----------------------------------------------------------------*/
    if (ParseTABFile(pszPath, bTestOpenNoError) != 0)
    {
        // Failed parsing... an error has already been produced if necessary
        CPLFree(pszPath);
        Close();
        return -1;
    }
    CPLFree(pszPath);
    pszPath = NULL;

    /*-----------------------------------------------------------------
     * __TODO__ For now, we support only 2 files linked through a single
     *          field... so we'll do some validation first to make sure
     *          that what we found in the header respects these limitations.
     *----------------------------------------------------------------*/
    if (m_numTABFiles != 2)
    {
        if (!bTestOpenNoError)
            CPLError(CE_Failure, CPLE_NotSupported,
                     "Open Failed: Dataset %s defines a view on %d tables. "
                     "This is not currently supported.",
                     m_pszFname, m_numTABFiles);
        Close();
        return -1;
    }

    /*-----------------------------------------------------------------
     * Open all the tab files listed in the view
     *----------------------------------------------------------------*/
    m_papoTABFiles = (TABFile**)CPLCalloc(m_numTABFiles, sizeof(TABFile*));

    for (int iFile=0; iFile < m_numTABFiles; iFile++)
    {
#ifndef _WIN32
        TABAdjustFilenameExtension(m_papszTABFnames[iFile]);
#endif
        
        m_papoTABFiles[iFile] = new TABFile;
   
        if ( m_papoTABFiles[iFile]->Open(m_papszTABFnames[iFile],
                                         "rb", bTestOpenNoError) != 0)
        {
            // Open Failed... an error has already been reported, just return.
            if (bTestOpenNoError)
                CPLErrorReset();
            Close();
            return -1;
        }
    }

    /*-----------------------------------------------------------------
     * Create TABRelation... this will build FeatureDefn, etc.
     * __TODO__ For now this assumes only 2 tables in the view...
     *----------------------------------------------------------------*/
    m_poRelation = new TABRelation;
    
    CPLAssert(m_nMainTableIndex == 0);
    CPLAssert(CSLCount(m_papszWhereClause) == 5);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品亚洲porn| 欧美高清精品3d| 91精品国产手机| 国产精品欧美久久久久无广告| 亚洲成人资源网| 国产一区二区视频在线| 欧美日韩一级二级| 国产精品不卡在线| 国产乱妇无码大片在线观看| 欧美精品亚洲二区| 亚洲激情一二三区| 成人高清视频在线| 亚洲精品一区二区三区蜜桃下载 | 日韩欧美专区在线| 亚洲精品免费播放| 成人国产电影网| 国产亚洲精品aa| 久久精品av麻豆的观看方式| 欧美色网站导航| 亚洲一区二区视频| 91久久精品国产91性色tv| 国产精品美女久久福利网站| 国产在线精品一区二区三区不卡| 日韩视频一区二区| 日本亚洲天堂网| 91精品久久久久久蜜臀| 午夜精品国产更新| 欧美三级资源在线| 亚洲成人精品在线观看| 欧美天堂亚洲电影院在线播放| 亚洲欧美视频在线观看视频| 99久精品国产| 亚洲图片你懂的| 一本大道久久a久久综合| 亚洲私人黄色宅男| 色综合久久久久综合99| 亚洲人快播电影网| 91丨九色丨蝌蚪富婆spa| 最新欧美精品一区二区三区| 99久久99久久久精品齐齐| 亚洲色图视频网站| 欧美在线一区二区三区| 午夜视频一区在线观看| 日韩欧美一二区| 国产精品夜夜爽| 中文字幕日韩精品一区 | 国产毛片精品国产一区二区三区| 精品久久国产字幕高潮| 国产福利视频一区二区三区| 久久久精品天堂| 99久久免费精品高清特色大片| 中文字幕一区不卡| 欧美日韩亚洲综合在线| 久久机这里只有精品| 国产精品女上位| 91免费版在线看| 五月婷婷激情综合| 日韩一级片网址| 成人高清视频免费观看| 午夜在线成人av| 久久久久久麻豆| 欧洲生活片亚洲生活在线观看| 日韩电影免费在线看| 国产日韩v精品一区二区| 91在线一区二区| 欧美aⅴ一区二区三区视频| 国产欧美日本一区二区三区| 欧美伊人久久久久久午夜久久久久| 青青草原综合久久大伊人精品| 欧美激情综合五月色丁香| 欧美在线视频不卡| 国产精品香蕉一区二区三区| 亚洲一区二区高清| 国产欧美日韩另类视频免费观看| 91成人在线免费观看| 国产一区二区三区香蕉| 亚洲一二三四在线观看| 国产人成亚洲第一网站在线播放| 欧美性受xxxx黑人xyx| 国产精品原创巨作av| 亚洲成a人片在线不卡一二三区| 2020国产精品自拍| 欧美亚洲国产一区二区三区va| 丁香婷婷深情五月亚洲| 奇米888四色在线精品| 亚洲伦理在线精品| 26uuuu精品一区二区| 欧美高清一级片在线| av在线播放成人| 国产麻豆精品视频| 老色鬼精品视频在线观看播放| 一区二区三区四区在线| 国产视频911| 久久女同互慰一区二区三区| 欧美日本免费一区二区三区| 91美女片黄在线| 丁香婷婷综合色啪| 国产高清精品在线| 国产一区中文字幕| 免费精品视频在线| 偷拍一区二区三区| 亚洲一区二区欧美日韩| 亚洲欧美日韩系列| 成人欧美一区二区三区| 欧美激情自拍偷拍| 久久久亚洲综合| 26uuu亚洲综合色| 精品国产成人系列| 欧美不卡一区二区| 精品国产91乱码一区二区三区| 欧美一区二区三区免费大片| 欧美猛男超大videosgay| 91国偷自产一区二区三区观看| 91香蕉视频mp4| 91看片淫黄大片一级在线观看| 99久久婷婷国产精品综合| 91丨porny丨国产入口| 91小宝寻花一区二区三区| 色婷婷精品大视频在线蜜桃视频| 一本到不卡精品视频在线观看| av电影一区二区| 在线视频你懂得一区二区三区| 91蝌蚪porny| 精品视频一区二区三区免费| 欧美系列日韩一区| 在线不卡中文字幕| 精品乱人伦小说| 久久久激情视频| 亚洲视频一区二区在线| 亚洲自拍欧美精品| 奇米精品一区二区三区在线观看一| 美国精品在线观看| 激情综合网天天干| 成人免费毛片a| 色天天综合久久久久综合片| 6080yy午夜一二三区久久| 欧美成人伊人久久综合网| 久久久久国产精品免费免费搜索| 久久综合五月天婷婷伊人| 国产清纯白嫩初高生在线观看91| 最新久久zyz资源站| 亚洲国产日韩av| 九九视频精品免费| 成人av影院在线| 欧美精品丝袜久久久中文字幕| 久久综合狠狠综合| 亚洲日本va午夜在线影院| 石原莉奈一区二区三区在线观看| 狠狠色丁香久久婷婷综| 成人高清视频免费观看| 337p亚洲精品色噜噜| 久久久www成人免费毛片麻豆 | 亚洲国产欧美在线| 国内久久精品视频| 色一区在线观看| 2020日本不卡一区二区视频| 亚洲综合在线电影| 国产一区二区三区在线观看免费视频| 成人av网站免费观看| 欧美一区二区二区| 国产精品福利一区| 激情综合五月天| 欧美日韩一二区| 自拍偷拍亚洲激情| 韩国欧美国产1区| 欧美日韩一区视频| 中文字幕乱码日本亚洲一区二区| 日韩电影在线一区二区| 成人黄色在线视频| 精品国产伦一区二区三区观看方式 | 一区二区高清在线| 激情小说欧美图片| 欧美美女喷水视频| 综合色中文字幕| 国产一区二区精品久久99| 69精品人人人人| 亚洲午夜一二三区视频| 高清shemale亚洲人妖| 日韩视频中午一区| 五月天精品一区二区三区| 99久久伊人精品| 久久久久久**毛片大全| 老司机精品视频一区二区三区| 欧美网站大全在线观看| 亚洲欧美日韩国产中文在线| 成人综合日日夜夜| 久久久久综合网| 久久不见久久见中文字幕免费| 欧美视频在线一区二区三区 | 日本va欧美va瓶| 制服丝袜亚洲精品中文字幕| 亚洲黄色小说网站| 99精品久久99久久久久| 国产日韩欧美一区二区三区综合| 喷白浆一区二区| 精品日韩一区二区三区| 全国精品久久少妇| 日韩欧美国产麻豆| 另类中文字幕网| 亚洲精品在线一区二区|