MCPcopy Create free account
hub / github.com/ImageEngine/cortex / pathToString

Method pathToString

src/IECoreScene/SceneInterface.cpp:142–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void SceneInterface::pathToString( const SceneInterface::Path &p, std::string &path )
143{
144 if ( !p.size() )
145 {
146 path = "/";
147 return;
148 }
149 size_t totalLength = 0;
150 for ( SceneInterface::Path::const_iterator it = p.begin(); it != p.end(); it++ )
151 {
152 totalLength += it->value().size();
153 }
154 totalLength += p.size();
155
156 path.resize( totalLength );
157 std::string::iterator sit = path.begin();
158 for ( SceneInterface::Path::const_iterator it = p.begin(); it != p.end(); it++ )
159 {
160 *sit++ = '/';
161 const std::string &str = it->value();
162 path.replace( sit, sit + str.size(), str );
163 sit += str.size();
164 }
165}
166
167void SceneInterface::stringToPath( const std::string &path, SceneInterface::Path &p )
168{

Callers 1

collectHashesWalkMethod · 0.80

Calls 5

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
resizeMethod · 0.45

Tested by 1

collectHashesWalkMethod · 0.64