File: strformat.cc

package info (click to toggle)
icmake 13.05.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,132 kB
  • sloc: cpp: 11,595; fortran: 883; makefile: 853; sh: 546; pascal: 342
file content (19 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//#define XERR
#include "builtin.ih"

// prints the formatted (%\d+) arguments into a string
// 
// The arguments are: the number of arguments [2], and then the 
// remaining arguments (the format string at [3]) in the order in which they
// are referred to by %\d. (%1 = [3 + 1], etc)
// 
// Since this is a formatted string print, insertReplace instead of insert is
// called directly 

void Builtin::strFormat()
{
    ostringstream out;
    insertReplace(out, d_stack[3].str(), 3);

    d_reg = out.str();
}