2016-02-10 00:12:00 +01:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2013-10-16 23:59:46 +02:00
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
//
|
2015-07-02 01:13:49 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-04-10 06:17:14 +02:00
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-10-04 06:49:15 +02:00
|
|
|
namespace rocksdb {
|
2013-05-21 20:37:06 +02:00
|
|
|
|
2014-11-21 17:05:28 +01:00
|
|
|
extern std::vector<std::string> StringSplit(const std::string& arg, char delim);
|
2013-05-21 20:37:06 +02:00
|
|
|
|
2014-11-25 05:44:49 +01:00
|
|
|
template <typename T>
|
|
|
|
inline std::string ToString(T value) {
|
2016-06-29 16:35:17 +02:00
|
|
|
#if !(defined OS_ANDROID) && !(defined CYGWIN) && !(defined OS_FREEBSD)
|
2014-11-25 05:44:49 +01:00
|
|
|
return std::to_string(value);
|
|
|
|
#else
|
2015-04-24 04:17:57 +02:00
|
|
|
// Andorid or cygwin doesn't support all of C++11, std::to_string() being
|
2014-11-25 05:44:49 +01:00
|
|
|
// one of the not supported features.
|
|
|
|
std::ostringstream os;
|
|
|
|
os << value;
|
|
|
|
return os.str();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-04-10 06:17:14 +02:00
|
|
|
} // namespace rocksdb
|