aboutsummaryrefslogtreecommitdiffstats
path: root/save-xml.c
AgeCommit message (Collapse)Author
2011-09-01Clean up save-file output a bitGravatar Linus Torvalds
Use the "empty element" form for samples that don't have any events associated with them (and none do, right now). This avoids that annoying "</sample>" crud. And output the units in the output helpers, so that you can't forget them even if you try. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Always use proper units when saving.Gravatar Linus Torvalds
When we see a number like 23.145, we'd better always also see a unit. It's just good practice. So add 'min' to duration (and use only two digits for number of seconds), and 'm' to depth. And write the date in international standard format. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Save everything in our current dives and samples into the xml fileGravatar Linus Torvalds
Now, as we start parsing more, we just need to also add the code to save it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Fix up small details in input/outputGravatar Linus Torvalds
Be more careful with FP conversions, and with the Kelvin<->C offset. And make sure to use the same names when saving as when parsing. Now when we save a set of dives, then re-load them, and save again, the second save image is identical to the first one. Of course, we don't actually save everything we load, so we still do lose information when we load and then save the result. But at least we now don't lose the information that we *do* save. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Add ability to 'save' divesGravatar Linus Torvalds
This just generates another xml file. Don't get me wrong: I still don't like xml, but this way we can save in the same format we load things from. Except the save-format is a *lot* cleaner than the abortion that is Suunto or libdivecomputer xml. Don't bother with some crazy xml library crap for saving. Just do it! Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>