src/MethodListing.cpp
// Accesses extra_inputs and accumulates a string containing
// query strings for each existing key of Inputs struct.
Accesses extra_inputs and accumulates a string containing
query strings for each existing key of Inputs struct.
Accesses extra_inputs and accumulates a string containing query strings for each existing key of Inputs struct .
std::string MethodListing::inputsToString() const {
    std::string str_inputs;
    if (!extra_inputs->after.empty())
        str_inputs.append("after=" + extra_inputs->after + "&");
    if (!extra_inputs->article.empty())
        str_inputs.append("article=" + extra_inputs->article + "&");
    if (!extra_inputs->before.empty())
        str_inputs.append("before=" + extra_inputs->before + "&");
    if (!extra_inputs->comment.empty())
        str_inputs.append("comment=" + extra_inputs->comment + "&");
    if (!extra_inputs->g.empty())
        str_inputs.append("g=" + extra_inputs->g + "&");
    if (!extra_inputs->t.empty())
        str_inputs.append("t=" + extra_inputs->t + "&");
    if (!extra_inputs->show.empty())
        str_inputs.append("show=" + extra_inputs->show + "&");
    if (!extra_inputs->sort.empty())
        str_inputs.append("sort=" + extra_inputs->sort + "&");
    if (extra_inputs->count > 0)
        str_inputs.append("count=" + std::to_string(extra_inputs->count) + "&");
    if (extra_inputs->depth > 0)
        str_inputs.append("depth=" + std::to_string(extra_inputs->depth) + "&");
    if (extra_inputs->limit > 0)
        str_inputs.append("limit=" + std::to_string(extra_inputs->limit) + "&");
    if (extra_inputs->context > 0 && extra_inputs->context < 9)
        str_inputs.append("context=" + std::to_string(extra_inputs->context) + "&");
    if (extra_inputs->truncate > 0 && extra_inputs->truncate < 51)
        str_inputs.append("context=" + std::to_string(extra_inputs->truncate) + "&");
    if (extra_inputs->showedits)
        str_inputs.append("showedits=true&");
    if (extra_inputs->showmore)
        str_inputs.append("showmore=true&");
    if (extra_inputs->sr_detail)
        str_inputs.append("sr_detail=true&");
    if (extra_inputs->threaded)
        str_inputs.append("threaded=true");
    auto iter = std::find(str_inputs.crbegin(), str_inputs.crend(), '&').base();
    if (str_inputs.end() - iter >= 3) {
        str_inputs.erase(iter);
    }
    return str_inputs;
}
std :: string MethodListing :: inputsToString ( ) const { std :: string str_inputs ; if ( ! extra_inputs -> after . empty ( ) ) str_inputs . append ( " " + extra_inputs -> after + " " ) ; if ( ! extra_inputs -> article . empty ( ) ) str_inputs . append ( " " + extra_inputs -> article + " " ) ; if ( ! extra_inputs -> before . empty ( ) ) str_inputs . append ( " " + extra_inputs -> before + " " ) ; if ( ! extra_inputs -> comment . empty ( ) ) str_inputs . append ( " " + extra_inputs -> comment + " " ) ; if ( ! extra_inputs -> g . empty ( ) ) str_inputs . append ( " " + extra_inputs -> g + " " ) ; if ( ! extra_inputs -> t . empty ( ) ) str_inputs . append ( " " + extra_inputs -> t + " " ) ; if ( ! extra_inputs -> show . empty ( ) ) str_inputs . append ( " " + extra_inputs -> show + " " ) ; if ( ! extra_inputs -> sort . empty ( ) ) str_inputs . append ( " " + extra_inputs -> sort + " " ) ; if ( extra_inputs -> count > 0 ) str_inputs . append ( " " + std :: to_string ( extra_inputs -> count ) + " " ) ; if ( extra_inputs -> depth > 0 ) str_inputs . append ( " " + std :: to_string ( extra_inputs -> depth ) + " " ) ; if ( extra_inputs -> limit > 0 ) str_inputs . append ( " " + std :: to_string ( extra_inputs -> limit ) + " " ) ; if ( extra_inputs -> context > 0 && extra_inputs -> context < 9 ) str_inputs . append ( " " + std :: to_string ( extra_inputs -> context ) + " " ) ; if ( extra_inputs -> truncate > 0 && extra_inputs -> truncate < 51 ) str_inputs . append ( " " + std :: to_string ( extra_inputs -> truncate ) + " " ) ; if ( extra_inputs -> showedits ) str_inputs . append ( " " ) ; if ( extra_inputs -> showmore ) str_inputs . append ( " " ) ; if ( extra_inputs -> sr_detail ) str_inputs . append ( " " ) ; if ( extra_inputs -> threaded ) str_inputs . append ( " " ) ; auto iter = std :: find ( str_inputs . crbegin ( ) , str_inputs . crend ( ) , ' ' ) . base ( ) ; if ( str_inputs . end ( ) - iter >= 3 ) { str_inputs . erase ( iter ) ; } return str_inputs ; }
Accesses extra_inputs and accumulates a string containing
query strings for each existing key of Inputs struct.
Accesses extra_inputs and accumulates a string containing query strings for each existing key of Inputs struct .
// String values // Integer Values // Short Values // Boolean Values //there is a leading &