|
GDAL
|
00001 /****************************************************************************** 00002 * $Id: cpl_csv.h 36376 2016-11-21 06:54:04Z goatbar $ 00003 * 00004 * Project: Common Portability Library 00005 * Purpose: Functions for reading and scanning CSV (comma separated, 00006 * variable length text files holding tables) files. 00007 * Author: Frank Warmerdam, warmerdam@pobox.com 00008 * 00009 ****************************************************************************** 00010 * Copyright (c) 1999, Frank Warmerdam 00011 * 00012 * Permission is hereby granted, free of charge, to any person obtaining a 00013 * copy of this software and associated documentation files (the "Software"), 00014 * to deal in the Software without restriction, including without limitation 00015 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00016 * and/or sell copies of the Software, and to permit persons to whom the 00017 * Software is furnished to do so, subject to the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be included 00020 * in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00023 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00024 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00025 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00026 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00027 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00028 * DEALINGS IN THE SOFTWARE. 00029 ****************************************************************************/ 00030 00031 #ifndef CPL_CSV_H_INCLUDED 00032 #define CPL_CSV_H_INCLUDED 00033 00034 #include <stdio.h> 00035 00036 #include "cpl_conv.h" 00037 #include "cpl_string.h" 00038 #include "cpl_vsi.h" 00039 00040 CPL_C_START 00041 00042 typedef enum { 00043 CC_ExactString, 00044 CC_ApproxString, 00045 CC_Integer 00046 } CSVCompareCriteria; 00047 00048 const char CPL_DLL *CSVFilename( const char * ); 00049 00050 char CPL_DLL CSVDetectSeperator( const char *pszLine ); 00051 00052 char CPL_DLL **CSVReadParseLine( FILE *fp); 00053 char CPL_DLL **CSVReadParseLine2( FILE *fp, char chDelimiter ); 00054 00055 char CPL_DLL **CSVReadParseLineL( VSILFILE *fp); 00056 char CPL_DLL **CSVReadParseLine2L( VSILFILE *fp, char chDelimiter ); 00057 00058 char CPL_DLL **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria ); 00059 char CPL_DLL **CSVScanLinesL( VSILFILE *, int, const char *, CSVCompareCriteria ); 00060 char CPL_DLL **CSVScanFile( const char *, int, const char *, 00061 CSVCompareCriteria ); 00062 char CPL_DLL **CSVScanFileByName( const char *, const char *, const char *, 00063 CSVCompareCriteria ); 00064 char CPL_DLL **CSVGetNextLine( const char * ); 00065 int CPL_DLL CSVGetFieldId( FILE *, const char * ); 00066 int CPL_DLL CSVGetFieldIdL( VSILFILE *, const char * ); 00067 int CPL_DLL CSVGetFileFieldId( const char *, const char * ); 00068 00069 void CPL_DLL CSVDeaccess( const char * ); 00070 00071 const char CPL_DLL *CSVGetField( const char *, const char *, const char *, 00072 CSVCompareCriteria, const char * ); 00073 00074 void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) ); 00075 00076 CPL_C_END 00077 00078 #endif /* ndef CPL_CSV_H_INCLUDED */
1.7.6.1.