C++: Change arguments of Input::send() from std::string to data+length.
This commit is contained in:
parent
8d80146722
commit
2b51d48b38
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue