00001 #ifndef BUFFERPARSERINPUT_H 00002 #define BUFFERPARSERINPUT_H 00003 00008 /* 00009 * Copyright (C) 2003-2006 Enrico Zini <enrico@debian.org> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Lesser General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2.1 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 00026 #include <tagcoll/ParserBase.h> 00027 #include <string> 00028 00029 namespace Tagcoll { 00030 00034 class MemParserInput : public ParserInput 00035 { 00036 protected: 00037 const std::string fname; 00038 const char* buf; 00039 int pos; 00040 int len; 00041 int _line; 00042 00043 public: 00044 MemParserInput(const std::string& fname, const char* buf, int len) throw (); 00045 MemParserInput(const char* buf, int len) throw (); 00046 virtual ~MemParserInput() throw () {} 00047 00048 virtual const std::string& fileName() const throw () { return fname; } 00049 virtual int lineNumber() const throw () { return _line; } 00050 00051 virtual int nextChar() throw (); 00052 virtual void pushChar(int c) throw (); 00053 }; 00054 00055 } 00056 00057 // vim:set ts=4 sw=4: 00058 #endif