Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
document the strbuf
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Jun 2016 08:50:06 +0000 (10:50 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Jun 2016 08:50:06 +0000 (10:50 +0200)
doc/doxygen/module-xbt.doc
include/xbt/strbuff.h
src/xbt/xbt_strbuff.c

index 14273f6..0673707 100644 (file)
@@ -21,6 +21,7 @@
       - \ref XBT_swag
       - \ref XBT_heap
       - \ref XBT_peer
+      - @ref xbt_strbuff
     - \ref XBT_misc
       - \ref XBT_graph
 
index ace5e34..2949420 100644 (file)
 
 SG_BEGIN_DECL()
 
-/** Buffer code **/
+/** @defgroup xbt_strbuff String buffers 
+ *  @ingroup XBT_adt
+ * 
+ *  This data container is very similar to the Java StringBuffer: 
+ *  that's a string to which you can add content with a lesser performance 
+ *  penalty than if you recreate a new string from scratch. Once done building 
+ *  your string, you must retrieve the content and free its container.
+ * 
+ *  @{
+ */
+
+/** @brief Buffer data container **/
 struct xbt_strbuff {
   char *data;
   int used, size;
@@ -35,5 +46,6 @@ XBT_PUBLIC(void) xbt_strbuff_chomp(xbt_strbuff_t b);
 XBT_PUBLIC(void) xbt_strbuff_trim(xbt_strbuff_t b);
 XBT_PUBLIC(void) xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns);
 
+/** @} */
 SG_END_DECL()
 #endif
index b73f511..0780895 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(strbuff, xbt, "String buffers");
 
+/** @brief Remove any content from the buffer */
 inline void xbt_strbuff_empty(xbt_strbuff_t b)
 {
   b->used = 0;
   b->data[0] = '\0';
 }
 
+/** @brief Constructor */
 xbt_strbuff_t xbt_strbuff_new(void)
 {
   xbt_strbuff_t res = xbt_malloc(sizeof(s_xbt_strbuff_t));
@@ -54,6 +56,7 @@ inline void xbt_strbuff_free(xbt_strbuff_t b)
   }
 }
 
+/** @brief Adds some content at the end of the buffer */
 void xbt_strbuff_append(xbt_strbuff_t b, const char *toadd)
 {
   int addlen;