rocksdb/util/string_util.cc
2017-07-20 21:09:43 -07:00

24 lines
649 B
C++

// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
#include <sstream>
#include <string>
#include <vector>
#include "util/string_util.h"
namespace rocksdb {
std::vector<std::string> StringSplit(const std::string& arg, char delim) {
std::vector<std::string> splits;
std::stringstream ss(arg);
std::string item;
while (std::getline(ss, item, delim)) {
splits.push_back(item);
}
return splits;
}
} // namespace rocksdb