namespace for functions and classes which partially emulate Boost functionality More...
Classes | |
class | format |
class | basic_format |
struct | format_metaprog |
struct | format_metaprog< basic_format< T1, T2 > > |
struct | string_only |
struct | string_only< std::string > |
struct | char_only |
struct | char_only< char > |
struct | basic_format_only |
struct | basic_format_only< basic_format< T > > |
struct | basic_format_only< basic_format< T1, T2 > > |
Functions | |
int | arma_snprintf (char *out, size_t size, const char *fmt,...) |
template<typename T2 > | |
basic_format< format, T2 > | operator% (const format &X, const T2 &arg) |
template<typename T1 , typename T2 , typename T3 > | |
basic_format< basic_format< T1, T2 >, T3 > | operator% (const basic_format< T1, T2 > &X, const T3 &arg) |
template<typename T2 > | |
std::string | str (const basic_format< format, T2 > &X) |
template<typename T2 , typename T3 > | |
std::string | str (const basic_format< basic_format< format, T2 >, T3 > &X) |
template<typename T2 , typename T3 , typename T4 > | |
std::string | str (const basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 > &X) |
template<typename T2 , typename T3 , typename T4 , typename T5 > | |
std::string | str (const basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 > &X) |
template<typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > | |
std::string | str (const basic_format< basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 >, T6 > &X) |
template<typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > | |
std::string | str (const basic_format< basic_format< basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 >, T6 >, T7 > &X) |
template<typename T1 , typename T2 > | |
std::string | str (const basic_format< T1, T2 > &X) |
template<typename T1 , typename T2 > | |
std::ostream & | operator<< (std::ostream &o, const basic_format< T1, T2 > &X) |
template<typename T1 > | |
static const T1 & | str_wrapper (const T1 &x, const typename string_only< T1 >::result *junk=0) |
template<typename T1 > | |
static const T1 * | str_wrapper (const T1 *x, const typename char_only< T1 >::result *junk=0) |
template<typename T1 > | |
static std::string | str_wrapper (const T1 &x, const typename basic_format_only< T1 >::result *junk=0) |
namespace for functions and classes which partially emulate Boost functionality
int arma_boost::arma_snprintf | ( | char * | out, | |
size_t | size, | |||
const char * | fmt, | |||
... | ||||
) | [inline] |
Definition at line 45 of file format_wrap.hpp.
Referenced by str().
basic_format< format, T2 > arma_boost::operator% | ( | const format & | X, | |
const T2 & | arg | |||
) | [inline] |
Definition at line 110 of file format_wrap.hpp.
basic_format< basic_format<T1,T2>, T3 > arma_boost::operator% | ( | const basic_format< T1, T2 > & | X, | |
const T3 & | arg | |||
) | [inline] |
Definition at line 120 of file format_wrap.hpp.
std::string arma_boost::str | ( | const basic_format< format, T2 > & | X | ) | [inline] |
Definition at line 130 of file format_wrap.hpp.
References arma_boost::format::A, arma_boost::basic_format< T1, T2 >::A, arma_snprintf(), and arma_boost::basic_format< T1, T2 >::B.
Referenced by operator<<(), and str_wrapper().
00131 { 00132 char local_buffer[1024]; 00133 char* buffer = local_buffer; 00134 00135 int buffer_size = 1024; 00136 int required_size = buffer_size; 00137 00138 bool using_local_buffer = true; 00139 00140 std::string out; 00141 00142 do 00143 { 00144 if(using_local_buffer == false) 00145 { 00146 buffer = new char[buffer_size]; 00147 } 00148 00149 required_size = arma_snprintf(buffer, buffer_size, X.A.A.c_str(), X.B); 00150 00151 if(required_size < buffer_size) 00152 { 00153 if(required_size > 0) 00154 { 00155 out = buffer; 00156 } 00157 } 00158 else 00159 { 00160 buffer_size *= 2; 00161 } 00162 00163 if(using_local_buffer == true) 00164 { 00165 using_local_buffer = false; 00166 } 00167 else 00168 { 00169 delete[] buffer; 00170 } 00171 00172 } while( (required_size >= buffer_size) ); 00173 00174 return out; 00175 }
std::string arma_boost::str | ( | const basic_format< basic_format< format, T2 >, T3 > & | X | ) | [inline] |
Definition at line 182 of file format_wrap.hpp.
References arma_snprintf().
00183 { 00184 char local_buffer[1024]; 00185 char* buffer = local_buffer; 00186 00187 int buffer_size = 1024; 00188 int required_size = buffer_size; 00189 00190 bool using_local_buffer = true; 00191 00192 std::string out; 00193 00194 do 00195 { 00196 if(using_local_buffer == false) 00197 { 00198 buffer = new char[buffer_size]; 00199 } 00200 00201 required_size = arma_snprintf(buffer, buffer_size, X.A.A.A.c_str(), X.A.B, X.B); 00202 00203 if(required_size < buffer_size) 00204 { 00205 if(required_size > 0) 00206 { 00207 out = buffer; 00208 } 00209 } 00210 else 00211 { 00212 buffer_size *= 2; 00213 } 00214 00215 if(using_local_buffer == true) 00216 { 00217 using_local_buffer = false; 00218 } 00219 else 00220 { 00221 delete[] buffer; 00222 } 00223 00224 } while( (required_size >= buffer_size) ); 00225 00226 return out; 00227 }
std::string arma_boost::str | ( | const basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 > & | X | ) | [inline] |
Definition at line 234 of file format_wrap.hpp.
References arma_snprintf().
00235 { 00236 char local_buffer[1024]; 00237 char* buffer = local_buffer; 00238 00239 int buffer_size = 1024; 00240 int required_size = buffer_size; 00241 00242 bool using_local_buffer = true; 00243 00244 std::string out; 00245 00246 do 00247 { 00248 if(using_local_buffer == false) 00249 { 00250 buffer = new char[buffer_size]; 00251 } 00252 00253 required_size = arma_snprintf(buffer, buffer_size, X.A.A.A.A.c_str(), X.A.A.B, X.A.B, X.B); 00254 00255 if(required_size < buffer_size) 00256 { 00257 if(required_size > 0) 00258 { 00259 out = buffer; 00260 } 00261 } 00262 else 00263 { 00264 buffer_size *= 2; 00265 } 00266 00267 if(using_local_buffer == true) 00268 { 00269 using_local_buffer = false; 00270 } 00271 else 00272 { 00273 delete[] buffer; 00274 } 00275 00276 } while( (required_size >= buffer_size) ); 00277 00278 return out; 00279 }
std::string arma_boost::str | ( | const basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 > & | X | ) | [inline] |
Definition at line 286 of file format_wrap.hpp.
References arma_snprintf().
00287 { 00288 char local_buffer[1024]; 00289 char* buffer = local_buffer; 00290 00291 int buffer_size = 1024; 00292 int required_size = buffer_size; 00293 00294 bool using_local_buffer = true; 00295 00296 std::string out; 00297 00298 do 00299 { 00300 if(using_local_buffer == false) 00301 { 00302 buffer = new char[buffer_size]; 00303 } 00304 00305 required_size = arma_snprintf(buffer, buffer_size, X.A.A.A.A.A.c_str(), X.A.A.A.B, X.A.A.B, X.A.B, X.B); 00306 00307 if(required_size < buffer_size) 00308 { 00309 if(required_size > 0) 00310 { 00311 out = buffer; 00312 } 00313 } 00314 else 00315 { 00316 buffer_size *= 2; 00317 } 00318 00319 if(using_local_buffer == true) 00320 { 00321 using_local_buffer = false; 00322 } 00323 else 00324 { 00325 delete[] buffer; 00326 } 00327 00328 } while( (required_size >= buffer_size) ); 00329 00330 return out; 00331 }
std::string arma_boost::str | ( | const basic_format< basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 >, T6 > & | X | ) | [inline] |
Definition at line 338 of file format_wrap.hpp.
References arma_snprintf().
00339 { 00340 char local_buffer[1024]; 00341 char* buffer = local_buffer; 00342 00343 int buffer_size = 1024; 00344 int required_size = buffer_size; 00345 00346 bool using_local_buffer = true; 00347 00348 std::string out; 00349 00350 do 00351 { 00352 if(using_local_buffer == false) 00353 { 00354 buffer = new char[buffer_size]; 00355 } 00356 00357 required_size = arma_snprintf(buffer, buffer_size, X.A.A.A.A.A.A.c_str(), X.A.A.A.A.B, X.A.A.A.B, X.A.A.B, X.A.B, X.B); 00358 00359 if(required_size < buffer_size) 00360 { 00361 if(required_size > 0) 00362 { 00363 out = buffer; 00364 } 00365 } 00366 else 00367 { 00368 buffer_size *= 2; 00369 } 00370 00371 if(using_local_buffer == true) 00372 { 00373 using_local_buffer = false; 00374 } 00375 else 00376 { 00377 delete[] buffer; 00378 } 00379 00380 } while( (required_size >= buffer_size) ); 00381 00382 return out; 00383 }
std::string arma_boost::str | ( | const basic_format< basic_format< basic_format< basic_format< basic_format< basic_format< format, T2 >, T3 >, T4 >, T5 >, T6 >, T7 > & | X | ) | [inline] |
Definition at line 390 of file format_wrap.hpp.
References arma_snprintf().
00391 { 00392 char local_buffer[1024]; 00393 char* buffer = local_buffer; 00394 00395 int buffer_size = 1024; 00396 int required_size = buffer_size; 00397 00398 bool using_local_buffer = true; 00399 00400 std::string out; 00401 00402 do 00403 { 00404 if(using_local_buffer == false) 00405 { 00406 buffer = new char[buffer_size]; 00407 } 00408 00409 required_size = arma_snprintf(buffer, buffer_size, X.A.A.A.A.A.A.A.c_str(), X.A.A.A.A.A.B, X.A.A.A.A.B, X.A.A.A.B, X.A.A.B, X.A.B, X.B); 00410 00411 if(required_size < buffer_size) 00412 { 00413 if(required_size > 0) 00414 { 00415 out = buffer; 00416 } 00417 } 00418 else 00419 { 00420 buffer_size *= 2; 00421 } 00422 00423 if(using_local_buffer == true) 00424 { 00425 using_local_buffer = false; 00426 } 00427 else 00428 { 00429 delete[] buffer; 00430 } 00431 00432 } while( (required_size >= buffer_size) ); 00433 00434 return out; 00435 }
std::string arma_boost::str | ( | const basic_format< T1, T2 > & | X | ) | [inline] |
Definition at line 476 of file format_wrap.hpp.
References arma_boost::basic_format< T1, T2 >::A.
std::ostream& arma_boost::operator<< | ( | std::ostream & | o, | |
const basic_format< T1, T2 > & | X | |||
) | [inline] |
Definition at line 486 of file format_wrap.hpp.
References str().
00487 { 00488 o << str(X); 00489 return o; 00490 }
static const T1& arma_boost::str_wrapper | ( | const T1 & | x, | |
const typename string_only< T1 >::result * | junk = 0 | |||
) | [inline, static] |
Definition at line 519 of file format_wrap.hpp.
Referenced by arma_check().
static const T1* arma_boost::str_wrapper | ( | const T1 * | x, | |
const typename char_only< T1 >::result * | junk = 0 | |||
) | [inline, static] |
Definition at line 530 of file format_wrap.hpp.
static std::string arma_boost::str_wrapper | ( | const T1 & | x, | |
const typename basic_format_only< T1 >::result * | junk = 0 | |||
) | [inline, static] |
Definition at line 541 of file format_wrap.hpp.
References str().
00542 { 00543 return str(x); 00544 }