ImFusion SDK 4.3
Selector Class Reference

#include <AnatomyPlugin/include/ImFusion/AnatomyPlugin/Selector.h>

Style selector combining with logical OR multiple SelectorElem objects. More...

Detailed Description

Style selector combining with logical OR multiple SelectorElem objects.

Selectors either match or do not match an object in a given setting. This class is modeled after the CSS concept of a selector.

Public Member Functions

 Selector (SelectorElem selector)
 Convenience constructor to create a Selector from a single SelectorElem.
 
 Selector (std::vector< SelectorElem > selectors={})
 Constructor allowing specification of a list of SelectorElem objects.
 
bool match (const std::string &identifier, const Properties &attributesStructure, std::optional< AnatomicalStructure::ContentType > ct, const std::string &key, const Properties &attributesObject, const std::set< std::string > &pseudoClasses) const
 Returns true, if the given object in the given setting matches the selector.
 
const std::stringstr () const
 Returns a string representation of the selector.
 
Selector operator|| (const SelectorElem &sel) const
 Returns a Selector that combines this Selector with another SelectorElem using logical OR.
 
bool operator!= (const Selector &other) const
 

Static Public Member Functions

static std::optional< Selectorparse (const std::string &str)
 Parse a string into a Selector.
 

Constructor & Destructor Documentation

◆ Selector()

Selector ( std::vector< SelectorElem > selectors = {})
explicit

Constructor allowing specification of a list of SelectorElem objects.

Any selector must match for the resulting Selector to match (logical OR).

Member Function Documentation

◆ parse()

static std::optional< Selector > parse ( const std::string & str)
static

Parse a string into a Selector.

Returns
std::nullopt if the string is not a valid selector, otherwise returns the parsed Selector.

◆ str()

const std::string & str ( ) const

Returns a string representation of the selector.

This is the inverse of the parse function. Individual SelectorElem strings are combined with a comma.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close