[Lldb-commits] [lldb] [lldb-vscode] Allow specifying a custom escape prefix for LLDB commands (PR #69238)
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 19 07:26:46 PDT 2023
================
@@ -52,12 +52,17 @@ llvm::StringRef GetAsString(const llvm::json::Value &value);
/// \param[in] key
/// The key to use when extracting the value
///
+/// \param[in] defaultValue
+/// The default value to return if the key is not present
+///
/// \return
/// A llvm::StringRef that contains the string value for the
-/// specified \a key, or an empty string if there is no key that
+/// specified \a key, or the default value if there is no key that
/// matches or if the value is not a string.
-llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key);
-llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key);
+llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key,
+ llvm::StringRef defaultValue = "");
+llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key,
+ llvm::StringRef defaultValue = "");
----------------
walter-erquinigo wrote:
oh wow, good catch
https://github.com/llvm/llvm-project/pull/69238
More information about the lldb-commits
mailing list