ledbuffer.hpp

来自「是一个键盘测试程序」· HPP 代码 · 共 64 行

HPP
64 行
字号
#ifndef _LEDBUFFER_H__#define _LEDBUFFER_H__#include "ledtype.h"#ifdef __cplusplusextern "C" {#endifclass LedBuffer {public:	LedBuffer() {		m_count = 0;			m_used = 0;		m_data = NULL; 	}	virtual ~LedBuffer();	void setSize(int capacity);	int getSize();	BOOL isEmpty();	BOOL isFull();	int getMaxIndex();	/*	@return the newly appended string's id	*/	size_t GB2312ToUCS2(char* out_buf, size_t buf_len,					            const char* in_str);	size_t ToUCS2(char* out_buf, size_t buf_len,					const char* in_str,					const char* in_code);	int AppendUCS2(const unsigned short* str);	//int add(const char* str);	BOOL rm_byIndex(int idx);	/*	@return 0 , no item removed;	@return >0 , the count of items removed;	*/ 	int  rm_byDate(time_t timebegin,time_t timeend);	BOOL replaceUCS2(int idx,const unsigned short* str);	//BOOL replace(int idx, const char* str);	/*	  @ 0 return ok	  @ >0 output buffer too small, the minBuffersize;	  */	int textUCS2(unsigned short* buf,int size);	BOOL setDate(int idx, time_t date);	void clear();	int find_bycontentUCS2(const unsigned short* str);	int getcontentUCS2_byIndex(int idx,unsigned short* buf,int size);private:	int m_count;	int m_used;	void* m_data;};#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?