60#ifndef guWhiteboard_Buttons_h
61#define guWhiteboard_Buttons_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_Buttons_DEFINED
73#define guWhiteboard_Buttons_DEFINED
76#define Buttons_DEFINED
90 void init(
bool t_button1Pushed =
false,
bool t_button2Pushed =
false) {
100 Buttons(
bool t_button1Pushed =
false,
bool t_button2Pushed =
false) {
101 this->init(t_button1Pushed, t_button2Pushed);
142 return !(*
this == t_other);
147 return *
this ==
Buttons(t_other);
152 return !(*
this == t_other);
185#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
195#ifdef USE_WB_BUTTONS_C_CONVERSION
198 std::string descr = buffer;
201 std::ostringstream ss;
202 ss <<
"button1Pushed=" << (this->
button1Pushed() ?
"true" :
"false");
204 ss <<
"button2Pushed=" << (this->
button2Pushed() ?
"true" :
"false");
210#ifdef USE_WB_BUTTONS_C_CONVERSION
213 std::string toString = buffer;
216 std::ostringstream ss;
224#ifdef USE_WB_BUTTONS_C_CONVERSION
229 char * str_cstr =
const_cast<char *
>(t_str.c_str());
230 size_t temp_length = strlen(str_cstr);
231 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
236 char* var_str = &var_str_buffer[0];
238 char* key = &key_buffer[0];
245 if (index == 0 && str_cstr[0] ==
'{') {
251 for (
int i = index; i < length; i++) {
253 if (bracecount == 0 && str_cstr[i] ==
'=') {
258 if (bracecount == 0 && isspace(str_cstr[i])) {
265 if (bracecount == 0 && str_cstr[i] ==
',') {
269 if (str_cstr[i] ==
'{') {
273 if (str_cstr[i] ==
'}') {
275 if (bracecount < 0) {
280 if (i == length - 1) {
284 if (endKey >= startKey && endKey - startKey < length) {
285 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
286 key[(endKey - startKey) + 1] = 0;
290 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
291 var_str[(index - startVar) + 1] = 0;
297 if (strlen(key) > 0) {
298 if (0 == strcmp(
"button1Pushed", key)) {
300 }
else if (0 == strcmp(
"button2Pushed", key)) {
310 this->
set_button1Pushed(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
315 this->
set_button2Pushed(strcmp(var_str,
"true") == 0 || strcmp(var_str,
"1") == 0);
322 }
while(index < length);