Commit 47abfcdc authored by legoc's avatar legoc
Browse files

(split) Added endOfLine member in application stream events

parent 76ef88a6
...@@ -28,7 +28,7 @@ using namespace std; ...@@ -28,7 +28,7 @@ using namespace std;
namespace cameo { namespace cameo {
Output::Output() : Output::Output() :
m_id(0) { m_id(0), m_endOfLine(false) {
} }
int Output::getId() const { int Output::getId() const {
...@@ -39,6 +39,10 @@ const std::string& Output::getMessage() const { ...@@ -39,6 +39,10 @@ const std::string& Output::getMessage() const {
return m_message; return m_message;
} }
bool Output::isEndOfLine() const {
return m_endOfLine;
}
OutputStreamSocket::OutputStreamSocket(StreamSocketImpl * impl) : OutputStreamSocket::OutputStreamSocket(StreamSocketImpl * impl) :
m_ended(false), m_ended(false),
m_canceled(false), m_canceled(false),
...@@ -73,9 +77,11 @@ bool OutputStreamSocket::receive(Output& output) { ...@@ -73,9 +77,11 @@ bool OutputStreamSocket::receive(Output& output) {
int id = event[message::ApplicationStream::ID].GetInt(); int id = event[message::ApplicationStream::ID].GetInt();
string line = event[message::ApplicationStream::MESSAGE].GetString(); string line = event[message::ApplicationStream::MESSAGE].GetString();
bool endOfLine = event[message::ApplicationStream::EOL].GetBool();
output.m_id = id; output.m_id = id;
output.m_message = line; output.m_message = line;
output.m_endOfLine = endOfLine;
return true; return true;
} }
......
...@@ -40,10 +40,12 @@ public: ...@@ -40,10 +40,12 @@ public:
int getId() const; int getId() const;
const std::string& getMessage() const; const std::string& getMessage() const;
bool isEndOfLine() const;
private: private:
int m_id; int m_id;
std::string m_message; std::string m_message;
bool m_endOfLine;
}; };
......
...@@ -140,6 +140,7 @@ namespace message { ...@@ -140,6 +140,7 @@ namespace message {
namespace ApplicationStream { namespace ApplicationStream {
constexpr const char* ID = "id"; // required int32 id = 1; constexpr const char* ID = "id"; // required int32 id = 1;
constexpr const char* MESSAGE = "message"; // required string message = 2; constexpr const char* MESSAGE = "message"; // required string message = 2;
constexpr const char* EOL = "eol"; // boolean
} }
namespace SendParametersRequest { namespace SendParametersRequest {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment