SDC C-Project CF Review 프로그램
ReviewHistory/include/akCore/akBit.h
»õ ÆÄÀÏ
@@ -0,0 +1,57 @@
#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;
      }
   };
//};