1 /* 2 * Copyright 2008-2013, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef TERMINAL_CHAR_CLASSIFIER_H 6 #define TERMINAL_CHAR_CLASSIFIER_H 7 8 9 #include <vector> 10 11 #include "UTF8Char.h" 12 13 14 enum { 15 CHAR_TYPE_SPACE, 16 CHAR_TYPE_WORD_CHAR, 17 CHAR_TYPE_WORD_DELIMITER 18 }; 19 20 21 class UTF8Char; 22 23 class TerminalCharClassifier { 24 public: 25 virtual ~TerminalCharClassifier(); 26 27 virtual int Classify(const UTF8Char& character) = 0; 28 }; 29 30 31 class DefaultCharClassifier: public TerminalCharClassifier { 32 public: 33 DefaultCharClassifier( 34 const char* additionalWordChars); 35 36 virtual int Classify(const UTF8Char& character); 37 38 private: 39 std::vector<UTF8Char> fAdditionalWordChars; 40 }; 41 42 43 #endif // TERMINAL_CHAR_CLASSIFIER_H 44