src/types.cpp

changeset 1
c9b22c06307c
parent 0
bb264814dd81
child 6
67b6ef6917ba
equal deleted inserted replaced
0:bb264814dd81 1:c9b22c06307c
2 #include <QStringList> 2 #include <QStringList>
3 #include <QTextStream> 3 #include <QTextStream>
4 #include <assert.h> 4 #include <assert.h>
5 #include "types.h" 5 #include "types.h"
6 6
7 str doFormat( std::vector<StringFormatArg> args ) { 7 str doFormat( initlist<StringFormatArg> args ) {
8 assert( args.size() >= 1 ); 8 assert( args.size() >= 1 );
9 str text = args[0].value(); 9 str text = args.begin()->value();
10 10
11 for( uchar i = 1; i < args.size(); ++i ) 11 for( initlist<StringFormatArg>::iterator it = args.begin() + 1; it != args.end(); ++it )
12 text = text.arg( args[i].value() ); 12 text = text.arg( it->value() );
13 13
14 return text; 14 return text;
15 } 15 }
16 16
17 void doPrint( initlist<StringFormatArg> args ) { 17 void doPrint( initlist<StringFormatArg> args ) {

mercurial