📄 icedynablock.h
字号:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Guard
#ifndef __ICEDYNABLOCK_H__
#define __ICEDYNABLOCK_H__
struct ICECORE_API DynamicBlock
{
DynamicBlock() { Length = 0; Data = null; }
~DynamicBlock() { Release(); }
bool Release() { DELETEARRAY(Data); return true; }
bool Init(udword length)
{
Release();
Data = new ubyte[length];
CHECKALLOC(Data);
Length = length;
return true;
}
bool Compare(DynamicBlock* blc)
{
if(!blc) return false;
if(blc->Length!=Length) return false;
ubyte* Data2 = blc->Data;
for(udword i=0;i<Length;i++)
if(Data[i]!=Data2[i]) return false;
return true;
}
udword Length;
ubyte* Data;
};
class ICECORE_API DataBlock : public Cell
{
DECLARE_ICE_CLASS(DataBlock, Cell);
DECLARE_FIELDS;
// Initialize
bool Init(udword length) { return mBlock.Init(length); }
DynamicBlock mBlock;
};
#endif // __ICEDYNABLOCK_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -