static function to compile a format string.
779 stringstream stream(fmt);
782 static const boost::regex expr1(
"^([CSILFDXBOW])(:([1-9]+[0-9]*))?$");
783 static const boost::regex expr2(
"^([CSILFDX])(:([1-9]+[0-9]*))?$");
790 while (getline(stream, buffer,
';'))
793 if (!boost::regex_match(buffer, what, strict?expr2:expr1))
795 out <<
kRed <<
"Wrong format string '" << buffer <<
"'!" << endl;
799 const string t = what[1];
800 const string n = what[3];
802 const int cnt = n.empty() ? 0 : stoi(n);
805 format.second.first = cnt == 0 ? 1 : cnt;
816 if (t[0]==
'C' && cnt==0)
818 format.first = GetType<string>();
819 list.push_back(format);
820 format.second.second = 0;
827 case 'B': format.first = GetType<bool>();
break;
828 case 'C': format.first = GetType<char>();
break;
829 case 'S': format.first = GetType<short>();
break;
830 case 'I': format.first = GetType<int>();
break;
831 case 'L': format.first = GetType<long>();
break;
832 case 'F': format.first = GetType<float>();
break;
833 case 'D': format.first = GetType<double>();
break;
834 case 'X': format.first = GetType<long long>();
break;
835 case 'O': format.first = GetVoid<O>();
break;
836 case 'W': format.first = GetVoid<W>();
break;
839 out <<
kRed <<
"Format '" << t[0] <<
" not known!" << endl;
843 list.push_back(format);
844 format.second.second += format.first.second * format.second.first;
847 format.first = GetVoid<void>();
848 format.second.first = 0;
850 list.push_back(format);
std::vector< Format > FormatList
std::pair< Type, Offset > Format