forked from kbinani/libvsq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputStream.hpp
More file actions
62 lines (53 loc) · 1.58 KB
/
InputStream.hpp
File metadata and controls
62 lines (53 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* InputStream.hpp
* Copyright © 2012 kbinani
*
* This file is part of libvsq.
*
* libvsq is free software; you can redistribute it and/or
* modify it under the terms of the BSD License.
*
* libvsq is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef __InputStream_hpp__
#define __InputStream_hpp__
#include "vsqglobal.hpp"
#include <stdint.h>
VSQ_BEGIN_NAMESPACE
/**
* @brief 読み込みストリーム
*/
class InputStream{
public:
/**
* @brief 1 バイトを読み込む
* @return 読み込んだバイト値。ストリームの末尾に達した場合は負の値を返す
*/
virtual int read() = 0;
/**
* @brief バッファーに読み込む
* @param buffer 読み込んだデータを格納するバッファー
* @param startIndex 読み込んだデータを格納するオフセット
* @param length 読み込む長さ
* @return 読み込んだ長さ
*/
virtual int read( char *buffer, int64_t startIndex, int64_t length ) = 0;
/**
* @brief ファイルポインターを移動する
* @param position ファイルポインター
*/
virtual void seek( int64_t position ) = 0;
/**
* @brief ファイルポインターを取得する
* @return ファイルポインター
*/
virtual int64_t getPointer() = 0;
/**
* @brief ストリームを閉じる
*/
virtual void close() = 0;
};
VSQ_END_NAMESPACE
#endif // __InputStream_hpp__