[vConnect/trunk/stand2.0] added: InputStream
@@ -0,0 +1,56 @@ | ||
1 | +/* | |
2 | + * InputStream.h | |
3 | + * Copyright © 2012 kbinani | |
4 | + * | |
5 | + * This file is part of vConnect-STAND. | |
6 | + * | |
7 | + * vConnect-STAND is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GPL License. | |
9 | + * | |
10 | + * vConnect-STAND 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. | |
13 | + */ | |
14 | +#ifndef __InputStream_h__ | |
15 | +#define __InputStream_h__ | |
16 | + | |
17 | +#include <string> | |
18 | + | |
19 | +namespace vconnect | |
20 | +{ | |
21 | + using namespace std; | |
22 | + | |
23 | + /** | |
24 | + * テキストを読み込むストリーム | |
25 | + */ | |
26 | + class InputStream | |
27 | + { | |
28 | + public: | |
29 | + /** | |
30 | + * ストリームを閉じる | |
31 | + */ | |
32 | + virtual void close() = 0; | |
33 | + | |
34 | + /** | |
35 | + * ストリームから1行分のデータを読み込む | |
36 | + * @return 1行分のデータ | |
37 | + */ | |
38 | + virtual string readLine() = 0; | |
39 | + | |
40 | + /** | |
41 | + * ストリームに対してさらに読み込めるかどうか | |
42 | + * @return 読み込める状態であれば true を返す | |
43 | + */ | |
44 | + virtual bool ready() = 0; | |
45 | + | |
46 | + /** | |
47 | + * デストラクタ | |
48 | + */ | |
49 | + virtual ~InputStream() | |
50 | + { | |
51 | + } | |
52 | + }; | |
53 | + | |
54 | +} | |
55 | + | |
56 | +#endif |