fpmas 1.6
format.h
Go to the documentation of this file.
1#ifndef FPMAS_FORMAT_H
2#define FPMAS_FORMAT_H
3
11#include <sstream>
12
13namespace fpmas { namespace utils {
23 template<typename T>
24 std::string format(std::string input, std::string replace, T arg) {
25 std::string str = input;
26 auto _rank = str.find(replace);
27 while(_rank != std::string::npos) {
28 std::stringstream s_arg;
29 s_arg << arg;
30 str.replace(_rank, replace.size(), s_arg.str());
31 _rank = str.find(replace, _rank+1);
32 }
33 return str;
34 }
42 std::string format(std::string input, int rank);
43
51 std::string format(std::string input, api::scheduler::TimeStep time);
52
62 std::string format(std::string input, int rank, api::scheduler::TimeStep time);
63}}
64
65#endif
unsigned long TimeStep
Definition: scheduler.h:29
std::string format(std::string input, int rank)
Definition: format.cpp:4
Definition: fpmas.cpp:3