diff options
-rw-r--r-- | src/announce.cc | 2 | ||||
-rw-r--r-- | src/file.cc | 19 | ||||
-rw-r--r-- | src/file.hh | 4 | ||||
-rw-r--r-- | src/portal.cc | 19 | ||||
-rw-r--r-- | src/portal.hh | 4 | ||||
-rw-r--r-- | src/storage.hh | 5 |
6 files changed, 52 insertions, 1 deletions
diff --git a/src/announce.cc b/src/announce.cc index a7a60c6..1400012 100644 --- a/src/announce.cc +++ b/src/announce.cc @@ -444,7 +444,7 @@ Formaline_AnnounceInitial (CCTK_ARGUMENTS) = * static_cast<CCTK_INT const *> (parameter_value); if (times_set > 0 or value != default_value) { - stores.store (key, value); + stores.store (key, (bool) value); } } break; 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); diff --git a/src/file.hh b/src/file.hh index 3c3c0ac..9da207f 100644 --- a/src/file.hh +++ b/src/file.hh @@ -26,6 +26,10 @@ public: virtual void store (char const * key, + bool value); + + virtual void + store (char const * key, int value); virtual void diff --git a/src/portal.cc b/src/portal.cc index 434ab1a..a0bcdba 100644 --- a/src/portal.cc +++ b/src/portal.cc @@ -125,6 +125,25 @@ portal:: void portal:: store (char const * const key, + bool const value) +{ + assert (key); + + ostringstream keybuf; + keybuf << key; + ostringstream valuebuf; + valuebuf << (value ? "true" : "false"); + + msgbuf << "<member>" + << "<name>" << clean (keybuf.str()) << "</name>" + << "<value><boolean>" << clean (valuebuf.str()) << "</boolean></value>" + << "</member>"; +} + + + +void portal:: +store (char const * const key, int const value) { assert (key); diff --git a/src/portal.hh b/src/portal.hh index 0be9074..b763654 100644 --- a/src/portal.hh +++ b/src/portal.hh @@ -73,6 +73,10 @@ public: virtual void store (char const * key, + bool value); + + virtual void + store (char const * key, int value); virtual void diff --git a/src/storage.hh b/src/storage.hh index 5728404..00a9c43 100644 --- a/src/storage.hh +++ b/src/storage.hh @@ -28,6 +28,11 @@ public: virtual void store (char const * key, + bool value) + = 0; + + virtual void + store (char const * key, int value) = 0; |