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

Method save

src/IECore/PathMatcherData.cpp:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54template<>
55void PathMatcherData::save( SaveContext *context ) const
56{
57 Data::save( context );
58 IndexedIOPtr container = context->container( staticTypeName(), g_ioVersion );
59
60 std::vector<InternedString> strings;
61 std::vector<unsigned int> pathLengths;
62 std::vector<unsigned char> exactMatches;
63
64 for( PathMatcher::RawIterator it = readable().begin(), eIt = readable().end(); it != eIt; ++it )
65 {
66 pathLengths.push_back( it->size() );
67 if( it->size() )
68 {
69 strings.push_back( it->back() );
70 }
71 exactMatches.push_back( it.exactMatch() );
72 }
73
74 container->write( "strings", strings.data(), strings.size() );
75 container->write( "pathLengths", pathLengths.data(), pathLengths.size() );
76 container->write( "exactMatches", exactMatches.data(), exactMatches.size() );
77}
78
79template<>
80void PathMatcherData::load( LoadContextPtr context )

Callers 1

testSaveAndLoadMethod · 0.95

Calls 6

containerMethod · 0.80
dataMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by 1

testSaveAndLoadMethod · 0.76