KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wx_any_utils.cpp File Reference
#include <properties/wx_any_utils.h>
#include <properties/property.h>
#include <geometry/eda_angle.h>
#include <gal/color4d.h>
#include <math/vector2d.h>
#include <math/box2.h>
#include <kiid.h>
#include <layer_ids.h>
#include <wx/string.h>
#include <optional>

Go to the source code of this file.

Functions

bool KiWxAnyEquals (const wxAny &aA, const wxAny &aB, const PROPERTY_BASE *aProperty)
 Compare two wxAny values for equality across the KiCad property type set.
 

Function Documentation

◆ KiWxAnyEquals()

bool KiWxAnyEquals ( const wxAny & aA,
const wxAny & aB,
const PROPERTY_BASE * aProperty = nullptr )

Compare two wxAny values for equality across the KiCad property type set.

This is a general-purpose comparator that dispatches over the scalar, string, geometry, color, identifier, and layer types that PROPERTY_BASE getters can carry. Two wxAny values are equal only when they hold the same supported type and that type's operator== reports equality; mismatched types compare unequal. An unsupported type pair is conservatively reported as not equal.

Passing the optional property lets enum-backed values be compared via the wxPGChoices integer payload (or label fallback), which is the only way to compare two PROPERTY_ENUM getters generically, since their wxAny stores the enum type rather than int.

Definition at line 39 of file wx_any_utils.cpp.

References PROPERTY_BASE::HasChoices(), and T.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and KICAD_DIFF::DiffItemProperties().