MCPcopy Create free account
hub / github.com/MITK/MITK / ToString

Method ToString

Modules/CppMicroServices/src/usLDAPExpr.cpp:621–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621const std::string LDAPExpr::ToString() const
622{
623 std::string res;
624 res.append("(");
625 if ((d->m_operator & SIMPLE) != 0)
626 {
627 res.append(d->m_attrName);
628 switch (d->m_operator)
629 {
630 case EQ:
631 res.append("=");
632 break;
633 case LE:
634 res.append("<=");
635 break;
636 case GE:
637 res.append(">=");
638 break;
639 case APPROX:
640 res.append("~=");
641 break;
642 }
643
644 for (std::size_t i = 0; i < d->m_attrValue.length(); i++)
645 {
646 Byte c = d->m_attrValue.at(i);
647 if (c == '(' || c == ')' || c == '*' || c == '\\')
648 {
649 res.append(1, '\\');
650 }
651 else if (c == LDAPExprConstants::WILDCARD())
652 {
653 c = '*';
654 }
655 res.append(1, c);
656 }
657 }
658 else
659 {
660 switch (d->m_operator)
661 {
662 case AND:
663 res.append("&");
664 break;
665 case OR:
666 res.append("|");
667 break;
668 case NOT:
669 res.append("!");
670 break;
671 }
672 for (std::size_t i = 0; i < d->m_args.size(); i++)
673 {
674 res.append(d->m_args[i].ToString());
675 }
676 }
677 res.append(")");
678 return res;

Callers 15

helpTextMethod · 0.45
generateXmlOutputMethod · 0.45
ReadMethod · 0.45
GetReaderMethod · 0.45
ReadMethod · 0.45
TestEvaluateFunction · 0.45
TestLDAPExpressionsFunction · 0.45
usModuleManifestTestFunction · 0.45
usAnyTestFunction · 0.45

Calls 3

WILDCARDFunction · 0.85
atMethod · 0.80
sizeMethod · 0.45

Tested by 8

TestEvaluateFunction · 0.36
TestLDAPExpressionsFunction · 0.36
usModuleManifestTestFunction · 0.36
usAnyTestFunction · 0.36
UsePreferenceListMethod · 0.36
SetOptionsMethod · 0.36