mirror of
https://github.com/ioquake/jedi-outcast.git
synced 2025-05-31 00:51:24 +00:00
Jedi Outcast v054
This commit is contained in:
commit
0c7c4bdee2
972 changed files with 686197 additions and 0 deletions
37
code/encryption/buffer.h
Normal file
37
code/encryption/buffer.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef __BUFFER_H
|
||||
#define __BUFFER_H
|
||||
|
||||
extern const int BufferIncrease;
|
||||
|
||||
class cBuffer
|
||||
{
|
||||
private:
|
||||
char *Buffer;
|
||||
int Size, ActualSize, Pos;
|
||||
bool FreeNextAdd;
|
||||
int Increase;
|
||||
|
||||
public:
|
||||
cBuffer(int InitIncrease = BufferIncrease);
|
||||
~cBuffer(void) { Free(); }
|
||||
|
||||
const char *Get(void) { return Buffer; }
|
||||
const char *GetWithPos(void) { return Buffer + Pos; }
|
||||
const int GetSize(void) { return Size; }
|
||||
const int GetRemaining(void) { return Size - Pos; }
|
||||
|
||||
void FreeBeforeNextAdd(void) { FreeNextAdd = true; }
|
||||
void ResetPos(void) { Pos = 0; }
|
||||
void ResetSize(void) { Size = 0; }
|
||||
|
||||
char *Add(char *Data, int Amount);
|
||||
void Read(void);
|
||||
char *Read(int Amount);
|
||||
bool ValidPos(void) { return (Pos < Size); }
|
||||
|
||||
size_t strcspn(const char *notin);
|
||||
|
||||
void Free(void);
|
||||
};
|
||||
|
||||
#endif // __BUFFER_H
|
Loading…
Add table
Add a link
Reference in a new issue