[common] MessageStorageFindFolders simplified implementation. 42/219342/3
authorMichal Michalski <m.michalski2@partner.samsung.com>
Wed, 4 Dec 2019 07:58:26 +0000 (08:58 +0100)
committerMichal Michalski <m.michalski2@partner.samsung.com>
Wed, 4 Dec 2019 12:49:06 +0000 (13:49 +0100)
+ add default constructor to PlatformResult
+ add tools::PostMessage overload for json message

[Verification] code compiles.

Signed-off-by: Michal Michalski <m.michalski2@partner.samsung.com>
Change-Id: Iafed8da9ebc6519f84f3341324f7ef4908ac9e61

src/common/extension.cc
src/common/extension.h
src/common/platform_result.cc
src/common/platform_result.h

index 9fc1547..713e03e 100644 (file)
@@ -250,6 +250,10 @@ void Instance::PostMessage(Instance* that, const char* msg) {
   LoggerE("Trying to post message to non-existing instance: [%p], ignoring", that);
 }
 
+void Instance::PostMessage(Instance* that, const picojson::value& json) {
+  Instance::PostMessage(that, json.serialize().c_str());
+}
+
 void Instance::PostMessage(const char* msg) {
   ScopeLogger();
   if (!xw_instance_) {
index 9bb16f4..f9e0e68 100644 (file)
@@ -94,6 +94,7 @@ class Instance {
   virtual ~Instance();
 
   static void PostMessage(Instance* that, const char* msg);
+  static void PostMessage(Instance* that, const picojson::value& json);
   void PostMessage(const char* msg);
   void SendSyncReply(const char* reply);
 
index f376528..39c3021 100644 (file)
 
 namespace common {
 
+PlatformResult::PlatformResult()
+  : PlatformResult(ErrorCode::NO_ERROR, "NO_ERROR") {
+}
+
 PlatformResult::PlatformResult(const ErrorCode& error_code, const std::string& message)
     : error_code_(error_code), message_(message) {
   ScopeLogger();
index 2683045..95b7c30 100644 (file)
@@ -72,6 +72,7 @@ enum class ErrorCode : int {
 
 class PlatformResult {
  public:
+  explicit PlatformResult();
   explicit PlatformResult(const ErrorCode& error_code, const std::string& message = "");
 
   ErrorCode error_code() const {