MCPcopy Create free account
hub / github.com/apache/trafficserver / ComputeFullBoolName

Method ComputeFullBoolName

lib/yamlcpp/src/emitter.cpp:762–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762const char* Emitter::ComputeFullBoolName(bool b) const {
763 const EMITTER_MANIP mainFmt = (m_pState->GetBoolLengthFormat() == ShortBool
764 ? YesNoBool
765 : m_pState->GetBoolFormat());
766 const EMITTER_MANIP caseFmt = m_pState->GetBoolCaseFormat();
767 switch (mainFmt) {
768 case YesNoBool:
769 switch (caseFmt) {
770 case UpperCase:
771 return b ? "YES" : "NO";
772 case CamelCase:
773 return b ? "Yes" : "No";
774 case LowerCase:
775 return b ? "yes" : "no";
776 default:
777 break;
778 }
779 break;
780 case OnOffBool:
781 switch (caseFmt) {
782 case UpperCase:
783 return b ? "ON" : "OFF";
784 case CamelCase:
785 return b ? "On" : "Off";
786 case LowerCase:
787 return b ? "on" : "off";
788 default:
789 break;
790 }
791 break;
792 case TrueFalseBool:
793 switch (caseFmt) {
794 case UpperCase:
795 return b ? "TRUE" : "FALSE";
796 case CamelCase:
797 return b ? "True" : "False";
798 case LowerCase:
799 return b ? "true" : "false";
800 default:
801 break;
802 }
803 break;
804 default:
805 break;
806 }
807 return b ? "y" : "n"; // should never get here, but it can't hurt to give
808 // these answers
809}
810
811const char* Emitter::ComputeNullName() const {
812 switch (m_pState->GetNullFormat()) {

Callers

nothing calls this directly

Calls 3

GetBoolLengthFormatMethod · 0.80
GetBoolFormatMethod · 0.80
GetBoolCaseFormatMethod · 0.80

Tested by

no test coverage detected