gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 line
3.1KB

  1. /******************************************************************************
  2. * $Id: cpl_csv.h 99aa5b9717f6d18543ca4487ebd4ccd34cb2b29e 2016-11-21 06:54:04Z Kurt Schwehr $
  3. *
  4. * Project: Common Portability Library
  5. * Purpose: Functions for reading and scanning CSV (comma separated,
  6. * variable length text files holding tables) files.
  7. * Author: Frank Warmerdam, warmerdam@pobox.com
  8. *
  9. ******************************************************************************
  10. * Copyright (c) 1999, Frank Warmerdam
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a
  13. * copy of this software and associated documentation files (the "Software"),
  14. * to deal in the Software without restriction, including without limitation
  15. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  16. * and/or sell copies of the Software, and to permit persons to whom the
  17. * Software is furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice shall be included
  20. * in all copies or substantial portions of the Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  27. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  28. * DEALINGS IN THE SOFTWARE.
  29. ****************************************************************************/
  30. #ifndef CPL_CSV_H_INCLUDED
  31. #define CPL_CSV_H_INCLUDED
  32. #include <stdio.h>
  33. #include "cpl_conv.h"
  34. #include "cpl_string.h"
  35. #include "cpl_vsi.h"
  36. CPL_C_START
  37. typedef enum {
  38. CC_ExactString,
  39. CC_ApproxString,
  40. CC_Integer
  41. } CSVCompareCriteria;
  42. const char CPL_DLL *CSVFilename( const char * );
  43. char CPL_DLL CSVDetectSeperator( const char *pszLine );
  44. char CPL_DLL **CSVReadParseLine( FILE *fp);
  45. char CPL_DLL **CSVReadParseLine2( FILE *fp, char chDelimiter );
  46. char CPL_DLL **CSVReadParseLineL( VSILFILE *fp);
  47. char CPL_DLL **CSVReadParseLine2L( VSILFILE *fp, char chDelimiter );
  48. char CPL_DLL **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria );
  49. char CPL_DLL **CSVScanLinesL( VSILFILE *, int, const char *, CSVCompareCriteria );
  50. char CPL_DLL **CSVScanFile( const char *, int, const char *,
  51. CSVCompareCriteria );
  52. char CPL_DLL **CSVScanFileByName( const char *, const char *, const char *,
  53. CSVCompareCriteria );
  54. char CPL_DLL **CSVGetNextLine( const char * );
  55. int CPL_DLL CSVGetFieldId( FILE *, const char * );
  56. int CPL_DLL CSVGetFieldIdL( VSILFILE *, const char * );
  57. int CPL_DLL CSVGetFileFieldId( const char *, const char * );
  58. void CPL_DLL CSVDeaccess( const char * );
  59. const char CPL_DLL *CSVGetField( const char *, const char *, const char *,
  60. CSVCompareCriteria, const char * );
  61. void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) );
  62. CPL_C_END
  63. #endif /* ndef CPL_CSV_H_INCLUDED */
上海开阖软件有限公司 沪ICP备12045867号-1