aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-05 21:01:12 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit7515bb32246098af42bb105e9e1256ce1f6018ae (patch)
treef5845c842f119f5be747ac6dd86bb30bc8bd5ebc /src/serdi.c
parent8bc4e0d94cdcd7b05ec50533cb8b618e47eb13aa (diff)
downloadserd-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.c23
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,