| 112 | // Join the keys of a map using the specified delimiter. |
| 113 | template<typename ITERATOR> |
| 114 | void JoinKeysIterator(const ITERATOR& start, |
| 115 | const ITERATOR& end, |
| 116 | const StringPiece& delim, |
| 117 | string *result) { |
| 118 | result->clear(); |
| 119 | for (ITERATOR iter = start; iter != end; ++iter) { |
| 120 | if (iter == start) { |
| 121 | StrAppend(result, iter->first); |
| 122 | } else { |
| 123 | StrAppend(result, delim, iter->first); |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | template <typename ITERATOR> |
| 129 | string JoinKeysIterator(const ITERATOR& start, |