vfs: check userland buffers before reading them.
[haiku.git] / src / apps / terminal / TerminalCharClassifier.h
blobde0d36411f30b0cb47de68289cfd91b62a8c10b0
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
9 #include <vector>
11 #include "UTF8Char.h"
14 enum {
15 CHAR_TYPE_SPACE,
16 CHAR_TYPE_WORD_CHAR,
17 CHAR_TYPE_WORD_DELIMITER
21 class UTF8Char;
23 class TerminalCharClassifier {
24 public:
25 virtual ~TerminalCharClassifier();
27 virtual int Classify(const UTF8Char& character) = 0;
31 class DefaultCharClassifier: public TerminalCharClassifier {
32 public:
33 DefaultCharClassifier(
34 const char* additionalWordChars);
36 virtual int Classify(const UTF8Char& character);
38 private:
39 std::vector<UTF8Char> fAdditionalWordChars;
43 #endif // TERMINAL_CHAR_CLASSIFIER_H