llreplace/llreplace.cpp
// ---------------------------------------------------------------------------
// Dump String, showing non-printable has hex value.
Dump String, showing non-printable has hex value.
Dump String showing non - printable has hex value .
static void DumpStr(const char* label, const std::string& str) {
    if (showPattern)
    {
        std::cerr << "Pattern " << label << " length=" << str.length() << std::endl;
        for (int idx = 0; idx < str.length(); idx++)
        {
            std::cerr << "  [" << idx << "]";
            if (isprint(str[idx]))
                std::cerr << str[idx] << std::endl;
            else
                std::cerr << "(hex) " << std::hex << (unsigned)str[idx] << std::dec << std::endl;
        }
        std::cerr << "[end-of-pattern]\n";
    }
}
static void DumpStr ( const char * label , const std :: string & str ) { if ( showPattern ) { std :: cerr << " " << label << " " << str . length ( ) << std :: endl ; for ( int idx = 0 ; idx < str . length ( ) ; idx ++ ) { std :: cerr << " " << idx << " " ; if ( isprint ( str [ idx ] ) ) std :: cerr << str [ idx ] << std :: endl ; else std :: cerr << " " << std :: hex << ( unsigned ) str [ idx ] << std :: dec << std :: endl ; } std :: cerr << " \n " ; } }
Dump String, showing non-printable has hex value.
Dump String showing non - printable has hex value .