first commit

This commit is contained in:
2026-06-22 11:49:35 +02:00
commit d805f2ba86
619 changed files with 126873 additions and 0 deletions

View File

@ -0,0 +1,60 @@
/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#ifndef __NBITFIELD__
#define __NBITFIELD__
#include "ntypes.h"
namespace GS {
class BitField
{
uint v;
public:
BitField &operator &= (uint b) { v &= b; return *this; }
BitField &operator |= (uint b) { v |= b; return *this; }
BitField &operator = (uint b) { v = b; return *this; }
BitField &operator &= (const BitField &b) { v &= b.v; return *this; }
BitField &operator |= (const BitField &b) { v |= b.v; return *this; }
BitField &operator = (const BitField &b) { v = b.v; return *this; }
bool operator == (const BitField &b) const { return v == b.v; }
bool operator != (const BitField &b) const { return v != b.v; }
inline uint Get() const
{
return v;
}
inline uint Set(uint b)
{
v |= b;
return v;
}
inline uint Remove(uint b)
{
v &= ~b;
return v;
}
inline uint Raise(uint b, bool raise = true)
{
return raise ? Set(b) : Remove(b);
}
inline bool IsSet(uint b) const { return asbool(v & b); }
BitField() : v(0) {}
};
}
#endif // __NBITFIELD__