MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / ToString

Method ToString

Code/Base/TypeSystem/PropertyPath.cpp:32–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

RestorePropertyStateMethod · 0.45

Calls 5

CtorSprintfClass · 0.85
sizeMethod · 0.45
c_strMethod · 0.45
IsArrayElementMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected