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

Method save

src/IECore/DateTimeData.cpp:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58/// in whatever form is most appropriate, using any of the features of the IndexedIO.
59template<>
60void DateTimeData::save( SaveContext *context ) const
61{
62 Data::save( context );
63 IndexedIO *container = context->rawContainer();
64
65 /// This is cross-platform and handles special values cleanly. It's also going to be smaller than
66 /// creating a proper container, and storing the day/month/year/time_of_day components individually.
67 /// Boost doesn't make this any easier for us as many of the time functions deal with "long" integer types,
68 /// meaning that on 32-bit platforms can't just store the number of nanoseconds since midnight (there are
69 /// ~10^14 nanoseconds in a day)
70 container->write( g_valueEntry, boost::posix_time::to_iso_string( readable() ) );
71}
72
73/// Here we specialise the TypedData::load() method to correctly load the data produced by save().
74template<>

Callers

nothing calls this directly

Calls 2

rawContainerMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected