MCPcopy Create free account
hub / github.com/SFML/SFML / getUdevAttributeUint

Function getUdevAttributeUint

src/SFML/Window/Unix/JoystickImpl.cpp:306–315  ·  view source on GitHub ↗

Get a udev property value for a joystick as an unsigned int

Source from the content-addressed store, hash-verified

304
305// Get a udev property value for a joystick as an unsigned int
306unsigned int getUdevAttributeUint(udev_device* udevDevice, const std::string& attributeName)
307{
308 if (!udevDevice)
309 return 0;
310
311 if (const char* attribute = getUdevAttribute(udevDevice, attributeName))
312 return static_cast<unsigned int>(std::strtoul(attribute, nullptr, 16));
313
314 return 0;
315}
316
317// Get the joystick vendor id
318unsigned int getJoystickVendorId(unsigned int index)

Callers 2

getJoystickVendorIdFunction · 0.85
getJoystickProductIdFunction · 0.85

Calls 1

getUdevAttributeFunction · 0.85

Tested by

no test coverage detected