summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-16 16:32:52 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-16 16:32:52 +0100
commited7929f1a3643a591f84b5362a9a1b85b3fb788d (patch)
treeb1360318923c51751cb98937b9d80978d72037d7 /src/lib/util.cc
parent60df561ea1c0e9dc108b6f117fa544df034489b0 (diff)
No-op; comments.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 9a0a8be82..cc201a0af 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -615,6 +615,12 @@ Rectangle::intersection (Rectangle const & other) const
);
}
+/** Round a number up to the nearest multiple of another number.
+ * @param a Number to round.
+ * @param t Multiple to round to.
+ * @return Rounded number.
+ */
+
int
round_up (int a, int t)
{
@@ -622,6 +628,13 @@ round_up (int a, int t)
return a - (a % t);
}
+/** Read a sequence of key / value pairs from a text stream;
+ * the keys are the first words on the line, and the values are
+ * the remainder of the line following the key. Lines beginning
+ * with # are ignored.
+ * @param s Stream to read.
+ * @return key/value pairs.
+ */
multimap<string, string>
read_key_value (istream &s)
{