<li>Initialize the <span style="font-family: Courier New,Courier,monospace">Eina_Strbuf</span> instance and create the buffer:
<pre class="prettyprint">
Eina_Strbuf *buf;
-mybuffer = eina_strbuf_new();
+buf = eina_strbuf_new();
</pre>
</li>
<li>Manage the buffer content:
<li>
<p>For basic strings, use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_append()</span> function:</p>
<pre class="prettyprint">
-eina_strbuf_append(mybuffer, "This is my string.");
+eina_strbuf_append(buf, "This is my string.");
</pre>
</li>
<li>To append 1 character to your buffer, use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_append_char()</span> function. You can also append a sized string to the buffer using the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_append_length()</span> function.
<pre class="prettyprint">
-eina_strbuf_append_length(mybuffer, "Buffe", 5);
-eina_strbuf_append_char(mybuffer, 'r');
+eina_strbuf_append_length(buf, "Buffe", 5);
+eina_strbuf_append_char(buf, 'r');
</pre>
</li>
<li>To handle "printf" format strings, use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_append_printf()</span> function to add formatted strings to the buffer:
</li>
</ul>
<pre class="prettyprint">
-eina_strbuf_append(mybuffer, "buffer buffer buffer");
+eina_strbuf_append(buf, "buffer buffer buffer");
// Replacing one occurrence of "buffer" by "B-U-F-F-E-R"
-eina_strbuf_replace(mybuffer, "buffer", "B-U-F-F-E-R", 1);
+eina_strbuf_replace(buf, "buffer", "B-U-F-F-E-R", 1);
// Replacing all the occurrences of "buffer" by "B-U-F-F-E-R"
-eina_strbuf_replace_all(mybuffer, "buffer", "B-U-F-F-E-R");
+eina_strbuf_replace_all(buf, "buffer", "B-U-F-F-E-R");
// Replacing all the occurrences of "B-U-F-F-E-R" by "Buffer"
-eina_strbuf_replace_all(mybuffer, "B-U-F-F-E-R", "Buffer");
+eina_strbuf_replace_all(buf, "B-U-F-F-E-R", "Buffer");
</pre>
</li>
<li>To insert a string at the specified position, use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_insert()</span> function. Use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_insert_printf()</span> function with formatted strings.
<pre class="prettyprint">
-eina_strbuf_insert(mybuffer, "More buffer", 10);
+eina_strbuf_insert(buf, "More buffer", 10);
// Using eina_strbuf_length_get to get the buffer length
eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
<li>To get the complete length of the string and the buffer, use the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_string_get()</span> and <span style="font-family: Courier New,Courier,monospace">eina_strbuf_length_get()</span> functions:
<pre class="prettyprint">
-printf("%s : %d\n", eina_strbuf_string_get(mybuffer), eina_strbuf_length_get(buf));
+printf("%s : %d\n", eina_strbuf_string_get(buf), eina_strbuf_length_get(buf));
</pre>
</li>
</ul>
<li>When no longer needed, free the buffer with the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_free()</span> function. You can also free the content of <span style="font-family: Courier New,Courier,monospace">Eina_Strbuf</span> without freeing the buffer itself using the <span style="font-family: Courier New,Courier,monospace">eina_strbuf_string_free()</span> function.
<pre class="prettyprint">
-eina_strbuf_free(mybuffer);
+eina_strbuf_free(buf);
</pre>
</li>
</ol>
</script>
</body>
-</html>
\ No newline at end of file
+</html>