Bind spec to a formatter. Used in ranges processing.
| 28 | //! Bind spec to a formatter. |
| 29 | //! Used in ranges processing. |
| 30 | class TSpecBoundFormatter |
| 31 | { |
| 32 | public: |
| 33 | explicit TSpecBoundFormatter(TStringBuf spec) |
| 34 | : Spec_(spec) |
| 35 | { } |
| 36 | |
| 37 | template <class T> |
| 38 | void operator()(TStringBuilderBase* builder, const T& obj) const |
| 39 | { |
| 40 | FormatValue(builder, obj, Spec_); |
| 41 | } |
| 42 | |
| 43 | private: |
| 44 | TStringBuf Spec_; |
| 45 | }; |
| 46 | |
| 47 | static constexpr TStringBuf DefaultJoinToStringDelimiter = ", "; |
| 48 | static constexpr TStringBuf DefaultKeyValueDelimiter = ": "; |