diff --git a/interfaces/kits/native/want/include/want.h b/interfaces/kits/native/want/include/want.h index c35449ff52c4cb5716a7240b480467cba708358a..ec71f84cfce36f946d6b3252e856d4dcdc36c629 100644 --- a/interfaces/kits/native/want/include/want.h +++ b/interfaces/kits/native/want/include/want.h @@ -804,6 +804,7 @@ public: void DumpInfo(int level) const; std::string ToString() const; + std::string ToFullString() const; static Want *FromString(std::string &string); diff --git a/interfaces/kits/native/want/src/want.cpp b/interfaces/kits/native/want/src/want.cpp index 56e394dad12cc06790df7d3fd8cb14793efbb69c..c5572c88737eae1692d13cfab5ccd79a23949673 100644 --- a/interfaces/kits/native/want/src/want.cpp +++ b/interfaces/kits/native/want/src/want.cpp @@ -1975,6 +1975,13 @@ std::string Want::ToString() const return ToJson().dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore); } +std::string Want::ToFullString() const +{ + nlohmann::json json = ToJson(); + json["moduleName"] = operation_.GetModuleName(); + return json.dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore); +} + Want *Want::FromString(std::string &string) { if (string.empty()) {