Skip to content

ABitField#

Bit field implementation.

Header:#include <AUI/Util/ABitField.h>
CMake:aui_link(my_target PUBLIC aui::core)

Public Methods#

checkAndReset#


bool ABitField::checkAndReset(T flag)

Determines whether flag set or not and sets flag.

Arguments
flag
flag
Returns
true if flag was reset

checkAndSet#


bool ABitField::checkAndSet(T flag)

Determines whether flag set or not and resets flag.

Arguments
flag
flag
Returns
true if flag was set

test#


bool ABitField::test(T flags)

Determines whether flag (or all flags) set or not.

Arguments
flags
flag(s)
Returns
true if flag(s) set

This function supports multiple flags (i.e check(FLAG1 | FLAG2)).

Examples#

examples/7guis/cells/tests/FormulaTests.cpp

7GUIs Cells - Spreadsheet processor (Excel).

    EXPECT_EQ(std::get<double>(formula::evaluate(mSpreadsheet, "0")), 0.0);
}

TEST_F(Cells_Formula, String) {
    EXPECT_EQ(std::get<AString>(formula::evaluate(mSpreadsheet, "test")), "test");
}

TEST_F(Cells_Formula, EConstant) {
    EXPECT_DOUBLE_EQ(std::get<double>(formula::evaluate(mSpreadsheet, "=1")), 1.0);
}

testAny#


bool ABitField::testAny(T flags)

Determines whether flag (or one of the flags flags) set or not.

Arguments
flags
flag(s)
Returns
true if flag(s) set

This function supports multiple flags (i.e check(FLAG1 | FLAG2)).