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 695 of file types.h.

Constructor & Destructor Documentation

◆ TypeSpecifier()

TypeSpecifier::TypeSpecifier ( )
inlineconstexprnoexcept

Definition at line 698 of file types.h.

698 :
699#define TSPEC(x) ,m_is##x(0)
700#define TSPEC0(x) m_is##x(0)
702#undef TSPEC0
703#undef TSPEC
704 {}
705
706 constexpr void reset() noexcept
707 {
708#define TSPEC(x) m_is##x = 0;
709#define TSPEC0(x) TSPEC(x)
711#undef TSPEC0
712#undef TSPEC
713 }
714
715 constexpr void merge(const TypeSpecifier &other) noexcept
716 {
717#define TSPEC(x) m_is##x = m_is##x || other.is##x();
718#define TSPEC0(x) TSPEC(x)
720#undef TSPEC0
721#undef TSPEC
722 }
723
724 friend inline bool operator==(const TypeSpecifier &t1,const TypeSpecifier &t2)
725 {
726 bool eq = true;
727#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
728#define TSPEC0(x) TSPEC(x)
730#undef TSPEC0
731#undef TSPEC
732 return eq;
733 }
constexpr TypeSpecifier() noexcept
Definition types.h:698
bool operator==(const DirIterator &it1, const DirIterator &it2)
Definition dir.cpp:166
#define TYPE_SPECIFIERS
Definition types.h:675

References TYPE_SPECIFIERS.

Referenced by operator!=.

Member Function Documentation

◆ to_string()

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

Definition at line 740 of file types.h.

741 {
742 std::string result="[";
743 bool first=true;
744#define TSPEC(x) \
745 if (m_is##x) { \
746 if (!first) result+=","; \
747 result+=#x; first=false; \
748 }
749#define TSPEC0(x) TSPEC(x)
751#undef TSPEC0
752#undef TSPEC
753 result+="]";
754 return result;
755 }

References TYPE_SPECIFIERS.

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

◆ operator!=

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

Definition at line 735 of file types.h.

736 {
737 return !(operator==(t1,t2));
738 }

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


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