aboutsummaryrefslogblamecommitdiffstats
path: root/util/string/printf.cpp
blob: 5b7c34d4e144d84f644bb29ee27817933edc825d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11

                               
                            
 
                                                         



                                 
                                             





                                         
                                     





                           
                                          







                                             
#include "printf.h"

#include <util/stream/printf.h>
#include <util/stream/str.h>

int vsprintf(TString& s, const char* c, va_list params) {
    TStringOutput so(s.remove());

    return Printf(so, c, params);
}

int sprintf(TString& s, const char* c, ...) {
    va_list params;
    va_start(params, c);
    const int k = vsprintf(s, c, params);
    va_end(params);
    return k;
}

TString Sprintf(const char* c, ...) {
    TString s;
    va_list params;
    va_start(params, c);
    vsprintf(s, c, params);
    va_end(params);
    return s;
}

int fcat(TString& s, const char* c, ...) {
    TStringOutput so(s);

    va_list params;
    va_start(params, c);
    const size_t ret = Printf(so, c, params);
    va_end(params);

    return ret;
}