diff options
author | David Robillard <d@drobilla.net> | 2011-05-11 22:57:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-11 22:57:00 +0000 |
commit | 9f6becfdd80dfe4cf1d99d0aefa8b257eb1b0c8d (patch) | |
tree | f9436edf22df60f6327babdcae00ea861d116a8f /sord | |
parent | a091efde0ab75c2ec2bfbb42cad083287fa891bc (diff) | |
download | sord-9f6becfdd80dfe4cf1d99d0aefa8b257eb1b0c8d.tar.gz sord-9f6becfdd80dfe4cf1d99d0aefa8b257eb1b0c8d.tar.bz2 sord-9f6becfdd80dfe4cf1d99d0aefa8b257eb1b0c8d.zip |
Preserve serd node flags for pretty serialisation.
git-svn-id: http://svn.drobilla.net/sord/trunk@107 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord')
-rw-r--r-- | sord/sord.h | 11 | ||||
-rw-r--r-- | sord/sordmm.hpp | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sord/sord.h b/sord/sord.h index 8159170..68c0289 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -209,8 +209,8 @@ sord_new_literal_counted(SordWorld* world, SordNode* datatype, const uint8_t* str, size_t str_len, - const char* lang, - uint8_t lang_len); + SerdNodeFlags flags, + const char* lang); /** Copy a node (i.e. obtain a reference). @@ -265,6 +265,13 @@ SordNode* sord_node_get_datatype(const SordNode* node); /** + Return the flags (string attributes) of a node. +*/ +SORD_API +SerdNodeFlags +sord_node_get_flags(const SordNode* node); + +/** Return true iff @c a is equal to @c b. Note this is much faster than comparing the node's strings. diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp index 5345b92..d37d6e5 100644 --- a/sord/sordmm.hpp +++ b/sord/sordmm.hpp @@ -67,7 +67,7 @@ public: static inline SerdNode string_to_node(SerdType type, const std::string& s) { SerdNode ret = { - (const uint8_t*)s.c_str(), s.length() + 1, s.length(), type }; + (const uint8_t*)s.c_str(), s.length() + 1, s.length(), 0, type }; return ret; } |