diff options
author | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-05-29 11:33:57 +0000 |
---|---|---|
committer | schnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f> | 2005-05-29 11:33:57 +0000 |
commit | 3996f4dec8488695fd5ab2a245b7b1ceec4651c5 (patch) | |
tree | 2641e0db3733b79bbce8f0b09cdf953e67ad09fd /src/file.cc | |
parent | c0a24229b042bc20258e368275684b45e8d683fe (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.cc | 19 |
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); |