Add jv string utility functions

jv_string_empty()
        -> return an empty string with given allocated length (for fast
           appends)
    jv_string_append_codepoint
        -> append a single codepoint (int) to the given string
    jv_string_explode
        -> return an array of codepoints making up a string
    jv_string_implode
        -> return the UTF-8 encoding of an array of codepoint numbers
This commit is contained in:
Nicolas Williams committed 2013-12-04 18:21:38 -06:00
1 parent 1fc5656762
commit 08b4a34a8e
2 files changed
+57

No files matched your search

+4
View File
@@ -75,14 +75,18 @@ jv jv_array_slice(jv, int, int);
jv jv_string(const char*);
jv jv_string_sized(const char*, int);
jv jv_string_empty(int len);
int jv_string_length_bytes(jv);
int jv_string_length_codepoints(jv);
unsigned long jv_string_hash(jv);
const char* jv_string_value(jv);
jv jv_string_concat(jv, jv);
jv jv_string_fmt(const char*, ...);
jv jv_string_append_codepoint(jv a, int c);
jv jv_string_append_buf(jv a, const char* buf, int len);
jv jv_string_append_str(jv a, const char* str);
jv jv_string_explode(jv j);
jv jv_string_implode(jv j);
jv jv_object();
jv jv_object_get(jv object, jv key);