C++: Change arguments of Input::send() from std::string to data+length.

This commit is contained in:
Martin Ling 2015-04-20 10:02:34 +01:00
parent 8d80146722
commit 2b51d48b38
2 changed files with 5 additions and 4 deletions

View File

@ -1438,9 +1438,9 @@ shared_ptr<InputDevice> Input::device()
return _device->get_shared_pointer(shared_from_this());
}
void Input::send(string data)
void Input::send(void *data, size_t length)
{
auto gstr = g_string_new(data.c_str());
auto gstr = g_string_new_len((gchar *)data, length);
auto ret = sr_input_send(_structure, gstr);
g_string_free(gstr, false);
check(ret);

View File

@ -888,8 +888,9 @@ public:
/** Virtual device associated with this input. */
shared_ptr<InputDevice> device();
/** Send next stream data.
* @param data Next stream data. */
void send(string data);
* @param data Next stream data.
* @param length Length of data. */
void send(void *data, size_t length);
/** Signal end of input data. */
void end();
protected: