26 inline bool num2s(
unsigned short a_value,std::string& a_s) {
27 return print2s(a_s,32,
"%u",a_value);
30 inline bool num2s(
short a_value,std::string& a_s){
31 return print2s(a_s,32,
"%d",a_value);
34 inline bool num2s(
unsigned int a_value,std::string& a_s) {
35 return print2s(a_s,32,
"%u",a_value);
44 inline bool num2s(
int a_value,std::string& a_s){
45 return print2s(a_s,32,
"%d",a_value);
56 inline bool num2s(
float a_value,std::string& a_s){
57 return print2s(a_s,32,
"%g",a_value);
60 inline bool num2s(
double a_value,std::string& a_s){
61 return print2s(a_s,32,
"%g",a_value);
64 inline bool size_t2s(
size_t a_value,std::string& a_s) {
65 if(
sizeof(
size_t)==8) {
73 if(
sizeof(ptrdiff_t)==8) {
89 inline bool numas(
const T& a_value,std::string& a_s){
91 if(!
num2s(a_value,stmp))
return false;
97 inline bool size_tas(
const T& a_value,std::string& a_s){
99 if(!
size_t2s(a_value,stmp))
return false;
116 inline bool num2s(
const std::string& a_value,std::string& a_s){a_s = a_value;
return true;}
120 typedef std::string parent;
127 parent::operator+=(
"\"");
128 if(!
numas(a_value,*
this)) {}
129 parent::operator+=(
"\"");
143 inline bool nums2s(
const VEC& a_vals,std::string& a_s,
const std::string& a_sep =
"\n",
bool a_sep_at_end =
false) {
145 typename VEC::size_type number = a_vals.size();
146 if(number<=0)
return true;
150 for(
typename VEC::size_type index=0;index<number;index++) {
151 if(!
num2s(a_vals[index],stmp)) status =
false;
155 if(!
num2s(a_vals[number],stmp)) status =
false;
157 if(a_sep_at_end) a_s += a_sep;
162 inline bool nums2s(
const std::vector<T>& a_vals,std::string& a_s,
const std::string& a_sep =
"\n",
bool a_sep_at_end =
false) {
163 return nums2s< std::vector<T> >(a_vals,a_s,a_sep,a_sep_at_end);