GEOS
3.3.2
|
00001 /********************************************************************** 00002 * $Id: StringTokenizer.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: ORIGINAL WORK 00018 * 00019 **********************************************************************/ 00020 00021 #ifndef GEOS_IO_STRINGTOKENIZER_H 00022 #define GEOS_IO_STRINGTOKENIZER_H 00023 00024 #include <geos/export.h> 00025 00026 #include <string> 00027 00028 #ifdef _MSC_VER 00029 #pragma warning(push) 00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00031 #endif 00032 00033 namespace geos { 00034 namespace io { 00035 00036 class GEOS_DLL StringTokenizer { 00037 public: 00038 enum { 00039 TT_EOF, 00040 TT_EOL, 00041 TT_NUMBER, 00042 TT_WORD 00043 }; 00044 //StringTokenizer(); 00045 StringTokenizer(const std::string& txt); 00046 ~StringTokenizer() {}; 00047 int nextToken(); 00048 int peekNextToken(); 00049 double getNVal(); 00050 std::string getSVal(); 00051 private: 00052 const std::string &str; 00053 std::string stok; 00054 double ntok; 00055 std::string::const_iterator iter; 00056 00057 // Declare type as noncopyable 00058 StringTokenizer(const StringTokenizer& other); 00059 StringTokenizer& operator=(const StringTokenizer& rhs); 00060 }; 00061 00062 } // namespace io 00063 } // namespace geos 00064 00065 #ifdef _MSC_VER 00066 #pragma warning(pop) 00067 #endif 00068 00069 #endif // #ifndef GEOS_IO_STRINGTOKENIZER_H 00070 00071 /********************************************************************** 00072 * $Log$ 00073 * Revision 1.1 2006/03/20 18:18:14 strk 00074 * io.h header split 00075 * 00076 **********************************************************************/