mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Load and save extra data in Subsurface XML format
Includes test dive to test missing attributes and the overall syntax. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9aefaa1ec8
commit
d6b4109409
3 changed files with 45 additions and 2 deletions
15
save-xml.c
15
save-xml.c
|
@ -301,6 +301,19 @@ static void save_tags(struct membuffer *b, struct tag_entry *entry)
|
|||
}
|
||||
}
|
||||
|
||||
static void save_extra_data(struct membuffer *b, struct extra_data *ed)
|
||||
{
|
||||
while (ed) {
|
||||
if (ed->key && ed->value) {
|
||||
put_string(b, " <extradata");
|
||||
show_utf8(b, ed->key, " key='", "'", 1);
|
||||
show_utf8(b, ed->value, " value='", "'", 1);
|
||||
put_string(b, " />\n");
|
||||
}
|
||||
ed = ed->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void show_date(struct membuffer *b, timestamp_t when)
|
||||
{
|
||||
struct tm tm;
|
||||
|
@ -341,7 +354,7 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer
|
|||
save_airpressure(b, dc);
|
||||
save_salinity(b, dc);
|
||||
put_duration(b, dc->surfacetime, " <surfacetime>", " min</surfacetime>\n");
|
||||
|
||||
save_extra_data(b, dc->extra_data);
|
||||
save_events(b, dc->events);
|
||||
save_samples(b, dc->samples, dc->sample);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue