GDAL
cplkeywordparser.h
00001 /******************************************************************************
00002  * $Id: cplkeywordparser.h 34931 2016-08-05 17:13:05Z rouault $
00003  *
00004  * Project:  Common Portability Library
00005  * Purpose:  Implementation of CPLKeywordParser - a class for parsing
00006  *           the keyword format used for files like QuickBird .RPB files.
00007  *           This is a slight variation on the NASAKeywordParser used for
00008  *           the PDS/ISIS2/ISIS3 formats.
00009  * Author:   Frank Warmerdam <warmerdam@pobox.com
00010  *
00011  ******************************************************************************
00012  * Copyright (c) 2008, Frank Warmerdam <warmerdam@pobox.com>
00013  *
00014  * Permission is hereby granted, free of charge, to any person obtaining a
00015  * copy of this software and associated documentation files (the "Software"),
00016  * to deal in the Software without restriction, including without limitation
00017  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00018  * and/or sell copies of the Software, and to permit persons to whom the
00019  * Software is furnished to do so, subject to the following conditions:
00020  *
00021  * The above copyright notice and this permission notice shall be included
00022  * in all copies or substantial portions of the Software.
00023  *
00024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00025  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00026  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00027  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00028  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00029  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00030  * DEALINGS IN THE SOFTWARE.
00031  ****************************************************************************/
00032 
00033 #ifndef CPL_KEYWORD_PARSER
00034 #define CPL_KEYWORD_PARSER
00035 
00036 #include "cpl_string.h"
00037 
00038 /************************************************************************/
00039 /* ==================================================================== */
00040 /*                          CPLKeywordParser                          */
00041 /* ==================================================================== */
00042 /************************************************************************/
00043 
00046 class CPLKeywordParser
00047 {
00048     char     **papszKeywordList;
00049 
00050     CPLString osHeaderText;
00051     const char *pszHeaderNext;
00052 
00053     void    SkipWhite();
00054     int     ReadWord( CPLString &osWord );
00055     int     ReadPair( CPLString &osName, CPLString &osValue );
00056     int     ReadGroup( const char *pszPathPrefix );
00057 
00058 public:
00059     CPLKeywordParser();
00060     ~CPLKeywordParser();
00061 
00062     int     Ingest( VSILFILE *fp );
00063 
00064     const char *GetKeyword( const char *pszPath, const char *pszDefault=NULL );
00065     char  **GetAllKeywords() { return papszKeywordList; }
00066 };
00067 
00070 #endif /* def CPL_KEYWORD_PARSER */

Generated for GDAL by doxygen 1.7.6.1.