54 std::ostringstream oss;
55 oss.setf(std::ios::fixed , std::ios::floatfield);
56 oss << std::setprecision(accuracy);
63 inline std::string
toHex(
const T i, std::streamsize numDigits = 0) {
65 std::stringstream stream;
66 stream <<
"0x" << std::setfill(
'0') << std::setw(numDigits == 0 ?
sizeof(T) * 2 : numDigits) << std::hex << i;
138 template <
typename V>
141 std::ostringstream oss;
142 for (
typename std::vector<V*>::const_iterator it = v.begin(); it != v.end(); ++it) {
143 if (it != v.begin()) {
146 oss << (*it)->getID();
152 template <
typename T,
typename T_BETWEEN>
154 std::ostringstream oss;
155 bool connect =
false;
156 for (
typename std::vector<T>::const_iterator it = v.begin(); it != v.end(); ++it) {
168 template <
typename T,
typename T_BETWEEN>
170 std::vector<T> sorted(v);
171 std::sort(sorted.begin(), sorted.end());
176 template <
typename V>
179 std::vector<std::string> ids;
180 for (
typename std::set<V*>::const_iterator it = v.begin(); it != v.end(); ++it) {
181 ids.push_back((*it)->getID());
188 inline std::string
toString(
const std::vector<int>& v, std::streamsize accuracy) {
194 inline std::string
toString(
const std::vector<SUMOReal>& v, std::streamsize accuracy) {
199 template <
typename T,
typename T_BETWEEN>
201 std::ostringstream oss;
202 bool connect =
false;
203 for (
typename std::set<T>::const_iterator it = s.begin(); it != s.end(); ++it) {
215 inline std::string
toString(
const std::set<std::string>& v, std::streamsize) {
219 template <
typename KEY,
typename VAL,
typename T_BETWEEN,
typename T_BETWEEN_KEYVAL>
220 inline std::string
joinToString(
const std::map<KEY, VAL>& s,
const T_BETWEEN& between,
const T_BETWEEN_KEYVAL& between_keyval, std::streamsize accuracy =
OUTPUT_ACCURACY) {
221 std::ostringstream oss;
222 bool connect =
false;
223 for (
typename std::map<KEY, VAL>::const_iterator it = s.begin(); it != s.end(); ++it) {
229 oss <<
toString(it->first, accuracy) << between_keyval <<
toString(it->second, accuracy);
235 inline std::string
toString(
const std::map<std::string, std::string>& v, std::streamsize) {