Closed GoogleCodeExporter closed 9 years ago
Okay, just figured out an example using the QDateTime type in Qt. For a more
generic version, you'd need to parse out the ISO8601 date yourself and come up
with a C++ class to represent it or use time_t; QDateTime already has the logic
for parsing ISO8601.
I think this is probably the only native YAML type that is missing in yaml-cpp,
so if we could get some standard representation going, that'd make others'
integration efforts a lot easier.
Original comment by stua...@longlandclan.yi.org
on 10 Mar 2015 at 8:58
Attachments:
I'm not convinced this is something that should go in the library proper, since
it's not a native C++ data type. Maybe once I switch to C++11 this could be
used with the new date types.
Original comment by jbe...@gmail.com
on 10 Mar 2015 at 9:41
Original comment by jbe...@gmail.com
on 10 Mar 2015 at 9:41
This is true, C++ doesn't have a native data type, but it doesn't have a Binary
type, yet there is YAML::Binary.
I've since found the parsing of timestamps in Qt is a little deficient (it
drops the fractional-seconds part it seems and has problems with timezones) so
I've built a Timestamp class that can be used as an initial stepping stone for
implementing conversion to other date/time types. Attached is a more complete
implementation that does string parsing and generation.
C++11 support would be nice, but not everyone is using it just now (GCC has it
marked as "experimental", so I'm staying with the earlier standard). The
attached class at least implements the parsing bit, so you could then extend it
to support the C++11 types.
Original comment by stua...@longlandclan.yi.org
on 29 Mar 2015 at 11:53
Attachments:
Binary data is just a sequence of bytes - I needed to wrap it in a type to be
able to use it easily.
Timestamps have much more structured data, so I'm less inclined to roll our
own. I'll keep this in mind, though.
Original comment by jbe...@gmail.com
on 30 Mar 2015 at 12:05
This issue has moved to github: https://github.com/jbeder/yaml-cpp/issues/284
Original comment by jbe...@gmail.com
on 1 Apr 2015 at 3:32
Original issue reported on code.google.com by
stua...@longlandclan.yi.org
on 10 Mar 2015 at 2:40