MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenImageIO / swapcase

Function swapcase

src/libutil/pystring.cpp:676–688  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

674 ///
675 ///
676 std::string swapcase( const std::string & str )
677 {
678 std::string s( str );
679 std::string::size_type len = s.size(), i;
680
681 for ( i = 0; i < len; ++i )
682 {
683 if ( ::islower( s[i] ) ) s[i] = ::toupper( s[i] );
684 else if (::isupper( s[i] ) ) s[i] = ::tolower( s[i] );
685 }
686
687 return s;
688 }
689
690 //////////////////////////////////////////////////////////////////////////////////////////////
691 ///

Callers 1

pystring.hFile · 0.85

Calls 3

islowerFunction · 0.85
isupperFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected