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.
|
|
|
|
//
|
2013-05-21 18:37:06 +00:00
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2014-04-10 04:17:14 +00:00
|
|
|
#include "util/string_util.h"
|
2013-05-21 18:37:06 +00:00
|
|
|
|
2013-10-04 04:49:15 +00:00
|
|
|
namespace rocksdb {
|
2013-05-21 18:37:06 +00:00
|
|
|
|
2014-04-10 04:17:14 +00:00
|
|
|
std::vector<std::string> stringSplit(std::string arg, char delim) {
|
|
|
|
std::vector<std::string> splits;
|
|
|
|
std::stringstream ss(arg);
|
|
|
|
std::string item;
|
|
|
|
while (std::getline(ss, item, delim)) {
|
2013-05-21 18:37:06 +00:00
|
|
|
splits.push_back(item);
|
|
|
|
}
|
|
|
|
return splits;
|
|
|
|
}
|
2014-04-10 04:17:14 +00:00
|
|
|
|
|
|
|
} // namespace rocksdb
|