2013-10-16 21:59:46 +00:00
|
|
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
|
|
|
// 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.
|
|
|
|
//
|
2014-04-10 04:17:14 +00:00
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-10-05 05:32:05 +00:00
|
|
|
#pragma once
|
2013-10-04 04:49:15 +00:00
|
|
|
namespace rocksdb {
|
2013-05-21 18:37:06 +00:00
|
|
|
|
2014-11-21 16:05:28 +00:00
|
|
|
extern std::vector<std::string> StringSplit(const std::string& arg, char delim);
|
2013-05-21 18:37:06 +00:00
|
|
|
|
2014-11-25 04:44:49 +00:00
|
|
|
template <typename T>
|
|
|
|
inline std::string ToString(T value) {
|
|
|
|
#ifndef OS_ANDROID
|
|
|
|
return std::to_string(value);
|
|
|
|
#else
|
|
|
|
// Andorid doesn't support all of C++11, std::to_string() being
|
|
|
|
// one of the not supported features.
|
|
|
|
std::ostringstream os;
|
|
|
|
os << value;
|
|
|
|
return os.str();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-04-10 04:17:14 +00:00
|
|
|
} // namespace rocksdb
|