summaryrefslogtreecommitdiff
path: root/src/messageparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/messageparser.h')
-rw-r--r--src/messageparser.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/messageparser.h b/src/messageparser.h
index 218f3a8..030c77b 100644
--- a/src/messageparser.h
+++ b/src/messageparser.h
@@ -27,13 +27,13 @@
*/
#pragma once
-#include "message.h"
-
#include <string>
#include <vector>
-MessageList parse_msg(std::string msg);
-MessageList parse_msg_client(std::string msg);
+#include "message.h"
+
+MessageList parse_msg(std::string msg, struct lws* wsi);
+MessageList parse_msg_client(std::string msg, struct lws* wsi);
//message_t create_msg(cmd::cmd_t type, node_t node);
@@ -52,3 +52,15 @@ message_t create_msg_create_with_attributes(node_t node,
message_t create_msg_update(node_t node, const std::string &attr);
message_t create_msg_remove(node_t node);
message_t create_msg_move(nodeid_t id, nodeid_t to, nodeid_t insertbeforeid);
+
+//! Create new error message.
+//! \param code is the ErrorCode for this error message.
+//! \param msg is the error in textural form for easy presentation on the
+//! clients.
+//! \param wsi is the client id that the error relates to (usually the one
+//! that sent the command resulting in the error)
+message_t create_msg_error(ErrorCode code, const std::string &msg,
+ struct lws* wsi);
+
+//! Convenience function.
+message_t create_msg_error(const ErrorMessage &error, struct lws* wsi);