class Core::IO::BitAccessor

Overview

Helper class to set/get bits in a byte array with safety checks. More…

#include <corebuffer.h>

class BitAccessor: public Core::IO::ConstBitAccessor
{
public:
    // construction

    BitAccessor(char* bytes, uint32 byteSize, bool reversed = false);

    // methods

    INLINE void setBit(uint32 bitIndex, bool state = true);
};

Inherited Members

public:
    // methods

    INLINE bool getBit(uint32 bitIndex) const;
    INLINE uint32 countBits() const;

Detailed Documentation

Helper class to set/get bits in a byte array with safety checks.

No buffer management is done!

Methods

INLINE void setBit(uint32 bitIndex, bool state = true)

Set value of bit at given index.