#pragma once
|
|
|
#include "akCoreLinker.h"
|
|
//namespace akCore
|
//{
|
|
class AKCORE_DLLSPEC CakBit
|
{
|
public:
|
CakBit(void);
|
CakBit(int nBit);
|
~CakBit(void);
|
|
|
void setBit(int nBit);
|
void setBitFlag(int nBitIndex, bool bFlag);
|
|
int getBit();
|
bool getBitFlag(int nBitIndex);
|
|
|
protected:
|
int m_nBit;
|
|
public:
|
//ºñÆ® üũ(onµÇÀÖÀ¸¸é true ¹Ýȯ)
|
static int bitChk(int orig, int target)
|
{
|
if(target<32 && (orig&(0x1 << target)))return 1;
|
else return 0;
|
}
|
|
//ºñÆ® ¿Â
|
static int bitOn(int orig, int target)
|
{
|
if(target<32)return orig|(0x1 << target);
|
else return orig;
|
}
|
|
//ºñÆ® ¿ÀÇÁ
|
static int bitOff(int orig, int target)
|
{
|
if(target<32)return orig&(~(0x1 << target));
|
else return orig;
|
}
|
|
//ºñÆ® ½ºÀ§Ä¡
|
static int bitTurn(int orig, int target)
|
{
|
if(target<32)return orig^(0x1 << target);
|
else return orig;
|
}
|
};
|
|
//};
|