blob: 0b1d27d506df6d009b6046f82c29d3ca572bd36d [file] [log] [blame]
Etienne Bergeronde1ec032016-05-10 15:31:15 +00001//===--- DanglingHandleCheck.cpp - clang-tidy------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "OptionsUtils.h"
11
12namespace clang {
13namespace tidy {
14namespace utils {
15namespace options {
16
17static const char StringsDelimiter[] = ";";
18
19std::vector<std::string> parseStringList(StringRef Option) {
20 SmallVector<StringRef, 4> Names;
21 Option.split(Names, StringsDelimiter);
22 std::vector<std::string> Result;
23 for (StringRef &Name : Names) {
24 Name = Name.trim();
25 if (!Name.empty())
26 Result.push_back(Name);
27 }
28 return Result;
29}
30
31std::string serializeStringList(ArrayRef<std::string> Strings) {
32 return llvm::join(Strings.begin(), Strings.end(), StringsDelimiter);
33}
34
35} // namespace options
36} // namespace utils
37} // namespace tidy
38} // namespace clang