| 225 | |
| 226 | |
| 227 | std::pair<bool, bool> WorkflowMachine::GetLogStatus() |
| 228 | { |
| 229 | rapidjson::Document request(rapidjson::kObjectType); |
| 230 | rapidjson::Document::AllocatorType& allocator = request.GetAllocator(); |
| 231 | request.AddMember("command", "status", allocator); |
| 232 | rapidjson::StringBuffer buffer; |
| 233 | rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); |
| 234 | request.Accept(writer); |
| 235 | |
| 236 | string jsonResult; |
| 237 | if (m_function) |
| 238 | jsonResult = BNPostWorkflowRequestForFunction(m_function->GetObject(), buffer.GetString()); |
| 239 | else |
| 240 | jsonResult = BNPostWorkflowRequestForBinaryView(m_view->GetObject(), buffer.GetString()); |
| 241 | |
| 242 | rapidjson::Document response(rapidjson::kObjectType); |
| 243 | response.Parse(jsonResult.c_str()); |
| 244 | if (response.HasMember("logStatus") && response["logStatus"].HasMember("local") && response["logStatus"].HasMember("global")) |
| 245 | return {response["logStatus"]["local"].GetBool(), response["logStatus"]["global"].GetBool()}; |
| 246 | |
| 247 | return {false, false}; |
| 248 | } |
| 249 | |
| 250 | |
| 251 | bool WorkflowMachine::SetLogEnabled(bool enable, bool global) |