| 30 | } |
| 31 | |
| 32 | String PropertyPath::ToString() const |
| 33 | { |
| 34 | String pathString; |
| 35 | |
| 36 | int32_t const numElements = (int32_t) m_pathElements.size(); |
| 37 | if ( numElements > 0 ) |
| 38 | { |
| 39 | for ( auto i = 0; i < numElements - 1; i++ ) |
| 40 | { |
| 41 | auto const& pathElement = m_pathElements[i]; |
| 42 | |
| 43 | pathString += pathElement.m_ID.c_str(); |
| 44 | |
| 45 | if ( pathElement.IsArrayElement() ) |
| 46 | { |
| 47 | pathString += String( String::CtorSprintf(), "/%d/", pathElement.m_arrayElementIdx ); |
| 48 | } |
| 49 | else |
| 50 | { |
| 51 | pathString += '/'; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // We dont want a trailing slash for the last element |
| 56 | //------------------------------------------------------------------------- |
| 57 | |
| 58 | auto const& pathElement = m_pathElements.back(); |
| 59 | pathString += pathElement.m_ID.c_str(); |
| 60 | if ( pathElement.IsArrayElement() ) |
| 61 | { |
| 62 | pathString += String( String::CtorSprintf(), "/%d", pathElement.m_arrayElementIdx ); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | return pathString; |
| 67 | } |
| 68 | |
| 69 | void PropertyPath::GenerateHashCode() |
| 70 | { |
no test coverage detected