test/tpmgr.cc
/// Use string src_str to configure Source sp.
///
Use string src_str to configure Source sp.
Use string src_str to configure Source sp .
bool src_init( spSource &sp, const char* src_str )
{
    std::string parserrs;
    Json::Value jvalue;
    Json::CharReaderBuilder builder;
    Json::CharReader *reader = builder.newCharReader();
    size_t n = strlen( src_str );
    if (reader->parse( src_str, src_str+n, &jvalue, &parserrs )) {
        sp->load( jvalue );
        delete reader;
        return true;
    }
    LOG_ERROR(Lgr) << "parse error: " << parserrs << '\n';
    delete reader;
    return false;
}
bool src_init ( spSource & sp , const char * src_str ) { std :: string parserrs ; Json :: Value jvalue ; Json :: CharReaderBuilder builder ; Json :: CharReader * reader = builder . newCharReader ( ) ; size_t n = strlen ( src_str ) ; if ( reader -> parse ( src_str , src_str + n , & jvalue , & parserrs ) ) { sp -> load ( jvalue ) ; delete reader ; return true ; } LOG_ERROR ( Lgr ) << " " << parserrs << ' \n ' ; delete reader ; return false ; }
Use string src_str to configure Source sp.
Use string src_str to configure Source sp .