diff options
author | David Robillard <d@drobilla.net> | 2018-07-05 21:01:12 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 7515bb32246098af42bb105e9e1256ce1f6018ae (patch) | |
tree | f5845c842f119f5be747ac6dd86bb30bc8bd5ebc /src/serdi.c | |
parent | 8bc4e0d94cdcd7b05ec50533cb8b618e47eb13aa (diff) | |
download | serd-7515bb32246098af42bb105e9e1256ce1f6018ae.tar.gz serd-7515bb32246098af42bb105e9e1256ce1f6018ae.tar.bz2 serd-7515bb32246098af42bb105e9e1256ce1f6018ae.zip |
Simplify writer style options
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/serdi.c b/src/serdi.c index 8939ae3b..9bf42ac2 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -205,25 +205,10 @@ main(int argc, char** argv) SerdWorld* world = serd_world_new(); SerdEnv* env = serd_env_new(base); - SerdStyleFlags output_style = 0; - if (output_syntax == SERD_NTRIPLES || ascii) { - output_style |= SERD_STYLE_ASCII; - } else if (output_syntax == SERD_TURTLE) { - output_style |= SERD_STYLE_ABBREVIATED; - if (!full_uris) { - output_style |= SERD_STYLE_CURIED; - } - } - - if ((input_syntax == SERD_TURTLE || input_syntax == SERD_TRIG) || - (output_style & SERD_STYLE_CURIED)) { - // Base URI may change and/or we're abbreviating URIs, so must resolve - output_style |= SERD_STYLE_RESOLVED; - } - - if (bulk_write) { - output_style |= SERD_STYLE_BULK; - } + const SerdStyleFlags output_style = + ((ascii ? SERD_STYLE_ASCII : 0) | // + (bulk_write ? SERD_STYLE_BULK : 0) | // + (full_uris ? (SERD_STYLE_UNQUALIFIED | SERD_STYLE_UNRESOLVED) : 0)); SerdWriter* writer = serd_writer_new(world, output_syntax, |