Add a formatter for folly::StringPiece

This commit is contained in:
Victor Zverovich
2018-07-14 06:33:16 -07:00
parent ae4a3945f5
commit e0f6a2f8be
5 changed files with 56 additions and 2 deletions

22
include/fmt/folly.h Normal file
View File

@@ -0,0 +1,22 @@
// Formatting library for C++ - folly::StringPiece formatter
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_FOLLY_H_
#define FMT_FOLLY_H_
#include <folly/Range.h>
#include "core.h"
FMT_BEGIN_NAMESPACE
template <typename Ctx>
inline internal::typed_value<Ctx, internal::string_type>
make_value(folly::StringPiece s) {
return string_view(s.data(), s.size());
}
FMT_END_NAMESPACE
#endif // FMT_FOLLY_H_