TextInputStream support parse from buffer.

This commit is contained in:
2023-10-10 01:12:38 +08:00
parent 252f2f6a1f
commit 70b6567029
2 changed files with 39 additions and 7 deletions

View File

@@ -67,7 +67,7 @@ namespace hgl
InputStream *input_stream; ///<输入流
uint8 *buffer; ///<缓冲区
char *buffer; ///<缓冲区
int32 buffer_size; ///<缓冲区大小
int32 cur_buf_size; ///<当前缓冲区大小
@@ -92,9 +92,13 @@ namespace hgl
public:
TextInputStream(InputStream *i,const int buf_size=HGL_SIZE_1MB);
TextInputStream(char *buf,const int buf_size);
virtual ~TextInputStream()
{
SAFE_CLEAR_ARRAY(buffer);
if(input_stream) //有input_stream证明是从流加载的需要删除临时缓冲区
{
SAFE_CLEAR_ARRAY(buffer);
}
}
void SetDefaultBOM(const ByteOrderMask &bo){default_bom=bo;} ///<设置缺省BOM头}