-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBufferRing.h
More file actions
68 lines (49 loc) · 1.67 KB
/
BufferRing.h
File metadata and controls
68 lines (49 loc) · 1.67 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
63
64
65
66
67
68
#ifndef __BUFFER_RING_H__
#define __BUFFER_RING_H__
#pragma once
#include "tools++.h"
// kindData
#define UNKNOWN_DATA 0
#define BINARY_DATA 1
#define TEXT_DATA 2
#define TEXT_HALFWAY 3
#define BINHEX_DATA 4
// inputSrc
#define OPERATION_DATA 0
#define INFO_DATA 1
#define WARN_DATA 2
#define ERROR_DATA 3
class CBufferRing
{
public:
CBufferRing(int size) { init(size); }
~CBufferRing(void);
public:
int init(int size);
void clear(void);
void putBufferRing(Buffer* buf, int input, int kind = BINHEX_DATA);
void rewriteBinHexBufferRing(int n, int input);
Buffer getBufferRing(void);
Buffer getBufferRing(int pos);
int getMaxBufSize(void) { return maxBufSize; }
int getMaxLineX(void) { return maxLineX; }
int getMaxLineY(void) { return maxLineY; }
int getTotalSize(void) { return tlDataSize; }
int getLastPosition(void) { return wPos; }
int getLengthX(int n) { if (n < 0) n += maxBufSize; return (int)strlen((const char*)pBuf[n % maxBufSize].buf); }
int getKindData(int n) { if (n < 0) n += maxBufSize; return kindData[n % maxBufSize]; }
public:
Buffer* pBuf;
protected:
int maxBufSize; // Buffer の数.ラインの数.
int tlDataSize;
int maxLineX; // コンテキストのXサイズ
int maxLineY; // コンテキストのYサイズ
int indentSize; //
int rPos;
int wPos;
int* kindData; //
int* inputSrc; //
};
#endif