Eric Blake
cdb87b1c4b
virBuffer: add way to trim back extra text
...
I'm tired of writing:
bool sep = false;
while (...) {
if (sep)
virBufferAddChar(buf, ',');
sep = true;
virBufferAdd(buf, str);
}
This makes it easier, allowing one to write:
while (...)
virBufferAsprintf(buf, "%s,", str);
virBufferTrim(buf, ",", -1);
to trim any remaining comma.
* src/util/buf.h (virBufferTrim): Declare.
* src/util/buf.c (virBufferTrim): New function.
* tests/virbuftest.c (testBufTrim): Test it.
2012-05-21 16:01:43 -06:00
..
2012-03-27 09:54:49 -06:00
2012-03-09 14:36:31 +01:00
2012-05-04 09:09:07 +02:00
2012-03-15 12:24:56 +08:00
2012-05-08 16:57:37 -06:00
2012-02-01 17:02:45 -07:00
2012-05-16 10:23:06 -06:00
2012-05-21 06:26:34 -04:00
2012-05-21 06:26:34 -04:00
2012-05-15 20:29:12 +02:00
2012-05-17 11:43:35 -06:00
2012-05-15 17:07:34 +01:00
2012-03-07 18:24:43 -07:00
2012-05-08 16:57:37 -06:00
2012-05-21 12:37:38 -06:00
2012-05-21 12:37:38 -06:00
2012-03-07 18:24:43 -07:00
2012-03-07 18:24:43 -07:00
2012-05-08 16:57:37 -06:00
2012-05-08 16:57:37 -06:00
2012-04-02 09:33:54 -06:00
2012-03-07 18:24:43 -07:00
2012-03-30 11:47:14 +01:00
2012-04-27 17:25:35 -04:00
2012-05-08 16:57:37 -06:00
2012-04-23 10:59:51 +02:00
2012-05-08 16:57:37 -06:00
2012-03-27 15:52:25 +01:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-04-10 11:13:44 +01:00
2012-03-29 21:23:59 -06:00
2012-05-07 16:11:28 -06:00
2012-04-05 07:04:43 -04:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-05-16 10:23:06 -06:00
2012-05-21 06:26:34 -04:00
2012-05-08 16:57:37 -06:00
2012-03-26 14:45:22 -06:00
2012-05-17 11:12:40 -06:00
2012-02-27 16:06:02 -07:00
2012-05-17 11:43:35 -06:00
2012-05-17 11:43:35 -06:00
2012-03-26 14:45:22 -06:00
2012-04-17 22:56:18 +08:00
2012-05-16 10:05:46 +01:00
2012-03-30 11:47:24 +01:00
2012-03-26 14:45:22 -06:00
2012-03-30 11:47:14 +01:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-05-15 17:01:40 +01:00
2012-04-04 14:33:27 +01:00
2012-03-27 15:52:25 +01:00
2012-03-27 15:52:25 +01:00
2012-04-05 22:07:41 -06:00
2012-03-26 14:45:22 -06:00
2012-05-21 16:01:43 -06:00
2012-01-26 14:11:13 +00:00
2012-04-04 14:33:27 +01:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-03-30 11:47:24 +01:00
2012-04-05 22:07:41 -06:00
2012-05-01 14:58:14 -06:00
2012-03-26 14:45:22 -06:00
2012-04-05 22:07:41 -06:00
2012-02-24 11:53:23 +01:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-03-26 14:45:22 -06:00
2012-02-24 11:53:23 +01:00