summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2016-01-04 12:32:15 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-04 12:32:18 -0800
commit8c6adac0a5cd5decd3fd1688d1a45f368150ab83 (patch)
treea05a6bc43cfeb0667ee9bb625381de60b830ab2f
parent2c9131ac66b8a62be7a7a5c6cd6bc70f8b4d8939 (diff)
eina: update example with eina_strbuf_manage_read_only_new_length function.
Summary: The example is to demonstrate the use of eina_strbuf_manage_read_only_new_length API. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D3421 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/examples/eina/eina_strbuf_01.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/examples/eina/eina_strbuf_01.c b/src/examples/eina/eina_strbuf_01.c
index ae265c8569..8c8b65252e 100644
--- a/src/examples/eina/eina_strbuf_01.c
+++ b/src/examples/eina/eina_strbuf_01.c
@@ -40,6 +40,16 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
40 40
41 eina_strbuf_replace_all(buf, "length", "size"); 41 eina_strbuf_replace_all(buf, "length", "size");
42 printf("%s\n", eina_strbuf_string_get(buf)); 42 printf("%s\n", eina_strbuf_string_get(buf));
43 eina_strbuf_free(buf);
44
45 buf = eina_strbuf_manage_read_only_new_length("Example string", 14);
46 printf("%s\n", eina_strbuf_string_get(buf));
47
48 eina_strbuf_append_char(buf, '.');
49 printf("%s\n", eina_strbuf_string_get(buf));
50
51 eina_strbuf_append_length(buf, "Another string.", 15);
52 printf("%s\n", eina_strbuf_string_get(buf));
43 53
44 eina_strbuf_free(buf); 54 eina_strbuf_free(buf);
45 eina_shutdown(); 55 eina_shutdown();