aboutsummaryrefslogtreecommitdiff
path: root/src/file.cc
diff options
context:
space:
mode:
authorschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2005-05-29 11:33:57 +0000
committerschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2005-05-29 11:33:57 +0000
commit3996f4dec8488695fd5ab2a245b7b1ceec4651c5 (patch)
tree2641e0db3733b79bbce8f0b09cdf953e67ad09fd /src/file.cc
parentc0a24229b042bc20258e368275684b45e8d683fe (diff)
Store boolean variables with their own type instead of as integers.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@21 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/file.cc')
-rw-r--r--src/file.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/file.cc b/src/file.cc
index 2bff9b8..e009542 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -50,6 +50,25 @@ file::
void file::
store (char const * const key,
+ bool const value)
+{
+ assert (key);
+
+ ostringstream keybuf;
+ keybuf << key;
+ ostringstream valuebuf;
+ valuebuf << (value ? "yes" : "no");
+
+ ostringstream buf;
+ buf << clean (keybuf.str()) << "=" << clean (valuebuf.str()) << endl;
+
+ write (buf.str());
+}
+
+
+
+void file::
+store (char const * const key,
int const value)
{
assert (key);