Skip to content
Repos

DevPlaceApp

C++ 735 B24 lines Opens in site

Directory Raw Download

#pragma once
// Spec: shell.md section 9. Value describing a native alert; built from an Error with the Swift mapping:
// Cancelled gives no alert, Local shows its message, API-class errors with a status and a non-specific message
// show "(<status>) <message>", everything else shows the message.
#include <string>

#include "core/Result.hpp"

namespace dp {

class AlertMessage {
 public:
  bool isPresented = false;
  std::string title;
  std::string message;
  std::string buttonText;

  static AlertMessage none();
  static AlertMessage presentedError(const std::string& message);
  static AlertMessage presentedError(const Error& error);
  static AlertMessage presentedMessage(const std::string& message);
};

}  // namespace dp
19.7ms