Changes in directory llvm/lib/Support:
StringExtras.cpp updated: 1.4 -> 1.5 --- Log message: Add a helper function --- Diffs of the changes: (+15 -0) StringExtras.cpp | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/lib/Support/StringExtras.cpp diff -u llvm/lib/Support/StringExtras.cpp:1.4 llvm/lib/Support/StringExtras.cpp:1.5 --- llvm/lib/Support/StringExtras.cpp:1.4 Fri Jul 14 17:54:39 2006 +++ llvm/lib/Support/StringExtras.cpp Tue Nov 28 16:32:35 2006 @@ -42,6 +42,21 @@ return Result; } +/// SplitString - Split up the specified string according to the specified +/// delimiters, appending the result fragments to the output list. +void llvm::SplitString(const std::string &Source, + std::vector<std::string> &OutFragments, + const char *Delimiters) { + std::string S = Source; + + std::string S2 = getToken(S, Delimiters); + while (!S2.empty()) { + OutFragments.push_back(S2); + S2 = getToken(S, Delimiters); + } +} + + /// UnescapeString - Modify the argument string, turning two character sequences /// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \\ and _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits