src/main.cpp
std::string hasData(std::string s)
{
  auto found_null = s.find("null");
  auto b1 = s.find_first_of("[");
  auto b2 = s.find_first_of("}");
  if (found_null != std::string::npos) {
    return "";
  }
  else if (b1 != std::string::npos && b2 != std::string::npos) {
    return s.substr(b1, b2 - b1 + 2);
  }
  return "";
}
// Checks if the SocketIO event has JSON data.
// If there is data the JSON object in std::string format will be returned,
// else the empty std::string "" will be returned.

Checks if the SocketIO event has JSON data.
If there is data the JSON object in std::string format will be returned,
else the empty std::string "" will be returned.
Checks if the SocketIO event has JSON data . If there is data the JSON object in std :: string format will be returned else the empty std :: string " " will be returned .
std::string hasData(std::string s)
{
  auto found_null = s.find("null");
  auto b1 = s.find_first_of("[");
  auto b2 = s.find_first_of("}");
  if (found_null != std::string::npos) {
    return "";
  }
  else if (b1 != std::string::npos && b2 != std::string::npos) {
    return s.substr(b1, b2 - b1 + 2);
  }
  return "";
}
std :: string hasData ( std :: string s ) { auto found_null = s . find ( " " ) ; auto b1 = s . find_first_of ( " " ) ; auto b2 = s . find_first_of ( " " ) ; if ( found_null != std :: string :: npos ) { return " " ; } else if ( b1 != std :: string :: npos && b2 != std :: string :: npos ) { return s . substr ( b1 , b2 - b1 + 2 ) ; } return " " ; }
Checks if the SocketIO event has JSON data.
Checks if the SocketIO event has JSON data .