PageRenderTime 37ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/guitone-1.0rc5/src/util/AbstractParser.h

#
C Header | 49 lines | 25 code | 7 blank | 17 comment | 0 complexity | 82fe609999c8a8a797c8ba9dae4a592d MD5 | raw file
Possible License(s): GPL-3.0
  1. /***************************************************************************
  2. * Copyright (C) 2007 by Thomas Keller *
  3. * me@thomaskeller.biz *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation, either version 3 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  17. ***************************************************************************/
  18. #ifndef ABSTRACT_PARSER_H
  19. #define ABSTRACT_PARSER_H
  20. #include <QByteArray>
  21. #include <QString>
  22. class AbstractParser
  23. {
  24. public:
  25. AbstractParser(const QByteArray &);
  26. AbstractParser(const QString &);
  27. virtual ~AbstractParser();
  28. virtual bool parse() = 0;
  29. QByteArray getLeftBytes() const;
  30. int getLeftBytesCount() const;
  31. protected:
  32. char whatsNext(int count = 0) const;
  33. char getNext();
  34. QByteArray getNext(int);
  35. void eatSpaces();
  36. void advance(int count = 1);
  37. private:
  38. void init(const QByteArray &);
  39. QByteArray input;
  40. int charPos;
  41. };
  42. #endif