Add serialization to the Callout class

Adding serialize() and deserialize() APIs to the callout
class to save and restore the class data persistently.

The APIs take the directory to store the files in, and the
filename itself will be the ID, which is the callout number.

For example, a path could be:
/var/lib/ibm-logging/errors/5/callouts/0.

Tested: Passes the testcases in future commit.

Change-Id: I526f6483df71dbceac3a33f7ce8872f6914bcd9d
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/callout.hpp b/callout.hpp
index 7eec934..b1e3b53 100644
--- a/callout.hpp
+++ b/callout.hpp
@@ -100,8 +100,44 @@
         timestamp = ts;
     }
 
+    /**
+     * Serializes the class instance into a file in the
+     * directory passed in.  The filename will match the
+     * ID value passed into the constructor.
+     *
+     * @param[in] - the directory to save the file  in.
+     */
+    void serialize(const fs::path& dir);
+
+    /**
+     * Loads the class members in from a file written by a previous
+     * call to serialize().  The filename it uses is the ID
+     * value passed into the constructor in the directory
+     * passed to this function.
+     *
+     * @param[in] dir - the directory to look for the file in
+     *
+     * @return bool - true if the deserialization was successful,
+     *                false if it wasn't
+     */
+    bool deserialize(const fs::path& dir);
+
   private:
     /**
+     * Returns the fully qualified filename to use for the serialization
+     * data.  The file is the ID value, like "0", in the base directory
+     * passed in.
+     *
+     * @param[in] baseDir - the directory the file will be in
+     *
+     * @return path - the filename
+     */
+    inline auto getFilePath(const fs::path& baseDir)
+    {
+        return baseDir / std::to_string(entryID);
+    }
+
+    /**
      * The unique identifier for the callout, as error logs can have
      * multiple callouts.  They start at 0.
      */