Returns a string property. If the device index is not valid or the property is not a string type this function will * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing * null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */
| 3553 | * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing |
| 3554 | * null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */ |
| 3555 | inline uint32_t CVRPropertyHelpers::GetStringProperty( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, ETrackedPropertyError *pError ) |
| 3556 | { |
| 3557 | PropertyTypeTag_t unTag; |
| 3558 | ETrackedPropertyError error; |
| 3559 | uint32_t unRequiredSize = GetProperty( ulContainerHandle, prop, pchValue, unBufferSize, &unTag, &error ); |
| 3560 | if ( unTag != k_unStringPropertyTag && error == TrackedProp_Success ) |
| 3561 | { |
| 3562 | error = TrackedProp_WrongDataType; |
| 3563 | } |
| 3564 | |
| 3565 | if ( pError ) |
| 3566 | { |
| 3567 | *pError = error; |
| 3568 | } |
| 3569 | |
| 3570 | if ( error != TrackedProp_Success ) |
| 3571 | { |
| 3572 | if ( pchValue && unBufferSize ) |
| 3573 | { |
| 3574 | *pchValue = '\0'; |
| 3575 | } |
| 3576 | } |
| 3577 | |
| 3578 | return unRequiredSize; |
| 3579 | } |
| 3580 | |
| 3581 | |
| 3582 | /** Returns a string property as a std::string. If the device index is not valid or the property is not a string type this function will |
nothing calls this directly
no outgoing calls
no test coverage detected