================
@@ -290,6 +290,31 @@ class StructuredData {
 
     void GetDescription(lldb_private::Stream &s) const override;
 
+    /// Creates an Array of substrings by splitting a string around the
+    /// occurrences of a separator character.
+    ///
+    /// \param[in] s
+    ///   The input string.
+    ///
+    /// \param[in] separator
+    ///   The character to split on.
+    ///
+    /// \param[in] maxSplit
+    ///   The maximum number of times the string is split. If \a maxSplit is >=
+    ///   0, at most \a maxSplit splits are done and consequently <= \a 
maxSplit
+    ///   + 1 elements are returned.
+    ///
+    /// \param[in] keepEmpty
+    ///   True if empty substrings should be returned. Empty substrings still
+    ///   count when considering \a maxSplit.
+    ///
+    /// \return
+    ///   An array containing the substrings. If \a maxSplit == -1 and \a
+    ///   keepEmpty == true, then the concatination of the array forms the 
input
+    ///   string.
+    static ArraySP SplitString(llvm::StringRef s, char separator,
+                               int maxSplit = -1, bool keepEmpty = true);
+
----------------
clayborg wrote:

This API doesn't seem like it belongs in StructuredData. Also see the comment 
below about not splitting up the output and error into separate strings.

https://github.com/llvm/llvm-project/pull/90703
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to