StripSpaces: only strip spaces

StripWhitespace maintains old behavior
This commit is contained in:
Shawn Hoffman
2022-07-19 15:13:26 -07:00
parent e4ff49769c
commit f92541fbd9
20 changed files with 44 additions and 32 deletions

View File

@ -139,7 +139,7 @@ static std::string GetDeviceRefName(IOHIDDeviceRef inIOHIDDeviceRef)
{
const NSString* name = reinterpret_cast<const NSString*>(
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey)));
return (name != nullptr) ? std::string(StripSpaces([name UTF8String])) : "Unknown device";
return (name != nullptr) ? std::string(StripWhitespace([name UTF8String])) : "Unknown device";
}
static void DeviceRemovalCallback(void* inContext, IOReturn inResult, void* inSender,

View File

@ -164,7 +164,7 @@ std::string Joystick::Button::GetName() const
{
std::ostringstream s;
s << IOHIDElementGetUsage(m_element);
return std::string("Button ").append(StripSpaces(s.str()));
return std::string("Button ").append(StripWhitespace(s.str()));
}
Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir)
@ -210,7 +210,7 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
std::ostringstream s;
s << "CK-";
s << elementCookie;
description = StripSpaces(s.str());
description = StripWhitespace(s.str());
break;
}
}