Doxygen
Loading...
Searching...
No Matches
TypeSpecifier Class Reference

Wrapper class for a number of boolean properties. More...

#include <src/types.h>

Public Member Functions

constexpr TypeSpecifier () noexcept
std::string to_string () const

Friends

bool operator!= (const TypeSpecifier &t1, const TypeSpecifier &t2)

Detailed Description

Wrapper class for a number of boolean properties.

The properties are packed together, and initialized to false.

Definition at line 653 of file types.h.

Constructor & Destructor Documentation

◆ TypeSpecifier()

TypeSpecifier::TypeSpecifier ( )
inlineconstexprnoexcept

Definition at line 656 of file types.h.

656 :
657#define TSPEC(x) ,m_is##x(0)
658#define TSPEC0(x) m_is##x(0)
660#undef TSPEC0
661#undef TSPEC
662 {}
663
664 constexpr void reset() noexcept
665 {
666#define TSPEC(x) m_is##x = 0;
667#define TSPEC0(x) TSPEC(x)
669#undef TSPEC0
670#undef TSPEC
671 }
672
673 constexpr void merge(const TypeSpecifier &other) noexcept
674 {
675#define TSPEC(x) m_is##x = m_is##x || other.is##x();
676#define TSPEC0(x) TSPEC(x)
678#undef TSPEC0
679#undef TSPEC
680 }
681
682 friend inline bool operator==(const TypeSpecifier &t1,const TypeSpecifier &t2)
683 {
684 bool eq = true;
685#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
686#define TSPEC0(x) TSPEC(x)
688#undef TSPEC0
689#undef TSPEC
690 return eq;
691 }
constexpr TypeSpecifier() noexcept
Definition types.h:656
bool operator==(const DirIterator &it1, const DirIterator &it2)
Definition dir.cpp:160
#define TYPE_SPECIFIERS
Definition types.h:633

References TYPE_SPECIFIERS.

Referenced by operator!=.

Member Function Documentation

◆ to_string()

std::string TypeSpecifier::to_string ( ) const
inline

Definition at line 698 of file types.h.

699 {
700 std::string result="[";
701 bool first=true;
702#define TSPEC(x) \
703 if (m_is##x) { \
704 if (!first) result+=","; \
705 result+=#x; first=false; \
706 }
707#define TSPEC0(x) TSPEC(x)
709#undef TSPEC0
710#undef TSPEC
711 result+="]";
712 return result;
713 }

References TYPE_SPECIFIERS.

Referenced by fmt::formatter< TypeSpecifier >::format(), and printNavTree().

◆ operator!=

bool operator!= ( const TypeSpecifier & t1,
const TypeSpecifier & t2 )
friend

Definition at line 693 of file types.h.

694 {
695 return !(operator==(t1,t2));
696 }

References operator==(), and TypeSpecifier().


The documentation for this class was generated from the following file: