BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
d36272b
Branches
Tags
master
Blinker
src
noarch
StringParser.h
classes for format, size and position of Blinken frames
Stefan Schuermans
commited
d36272b
at 2011-11-17 19:54:45
StringParser.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef STRINGPARSER_H #define STRINGPARSER_H #include <string> namespace Blinker { /// a simple string parser class StringParser { public: /** * @brief constructor * @param[in] str string to parse */ StringParser(const std::string &str); public: /** * @brief parse fixed character * @param[in] chr character to expect * @return if expected character was found and processed */ bool fixChr(char chr); /** * @brief parse unsigned number and check minimum * @param[in] min minimum value to expect * @param[out] uint number parsed from string * @return if parsing was successful */ bool uintMin(unsigned int min, unsigned int &uint); /** * @brief check if parsing is done * @return if parsing is done (i.e. has arrived at the end of the string) */ bool isDone(); protected: std::string m_str; ///< string begin parsed std::string::const_iterator m_it; ///< current position of parsing }; // class StringParser } // namespace Blinker #endif // #ifndef STRINGPARSER_H