From d5264e1da655390bdef2ce99550024c69b7c4cb1 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 10 Oct 2023 02:45:00 +0800 Subject: [PATCH] delete "const" in TextInputStream --- inc/hgl/io/TextInputStream.h | 6 +++--- src/IO/TextInputStream.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/hgl/io/TextInputStream.h b/inc/hgl/io/TextInputStream.h index cdaead7..ebb75c0 100644 --- a/inc/hgl/io/TextInputStream.h +++ b/inc/hgl/io/TextInputStream.h @@ -26,7 +26,7 @@ namespace hgl virtual bool OnBOM(const ByteOrderMask &){return true;} ///<读取到BOM头的回调函数 - virtual bool OnLine(const T *text,const int len){return true;} + virtual bool OnLine(T *text,const int len){return true;} /** * 读取到一行文本的回调函数 @@ -34,7 +34,7 @@ namespace hgl * @param len 读取到的文本字长度 * @param line_end 当前行是否结束 */ - virtual bool OnLine(const T *text,const int len,const bool line_end) + virtual bool OnLine(T *text,const int len,const bool line_end) { if(!line_end) { @@ -85,7 +85,7 @@ namespace hgl private: - template int Parse(const T *,ParseCallback *); + template int Parse(T *,ParseCallback *); int TextBlockParse(); ///<文本块解析 diff --git a/src/IO/TextInputStream.cpp b/src/IO/TextInputStream.cpp index 73b6780..e1a6dc5 100644 --- a/src/IO/TextInputStream.cpp +++ b/src/IO/TextInputStream.cpp @@ -52,10 +52,10 @@ namespace hgl template<> void TextInputStream::SetParseCallback(ParseCallback *pc){callback_u16=pc;} template<> void TextInputStream::SetParseCallback(ParseCallback *pc){callback_u32=pc;} - template int TextInputStream::Parse(const T *p,ParseCallback *pc) + template int TextInputStream::Parse(T *p,ParseCallback *pc) { - const T *sp=(const T *)p; - const T *end=(const T *)(buffer+cur_buf_size); + T *sp=(T *)p; + T *end=(T *)(buffer+cur_buf_size); int line_count=0;