Logo Search packages:      
Sourcecode: einstein version File versions  Download package

std::wstring Formatter::format ( va_list  ap  )  const

Fromat message

Parameters:
ap list of arguments

Definition at line 150 of file formatter.cpp.

References getMessage().

{
    if (! argsCnt)
        return getMessage();
    
    std::vector<ArgValue*> argValues;
    
    for (int i = 0; i < argsCnt; i++) {
        switch (args[i]) {
            case INT_ARG:
                argValues.push_back(new TemplatedArgValue<int>
                        (va_arg(ap, int))); 
                break;
            case STRING_ARG:
                argValues.push_back(new StrArgValue(va_arg(ap, wchar_t*)));
                break;
            case DOUBLE_ARG:
                argValues.push_back(new TemplatedArgValue<double>
                        (va_arg(ap, double)));
                break;
            case FLOAT_ARG:
                argValues.push_back(new TemplatedArgValue<float>
                        ((float)va_arg(ap, double)));
                break;
            default:
                i = argsCnt;
        }
    }
 
    std::wstring s = format(argValues);

    for (std::vector<ArgValue*>::iterator i = argValues.begin();
            i != argValues.end(); i++)
        delete *i;
    
    return s;
}


Generated by  Doxygen 1.6.0   Back to index