<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Am 15.09.20 um 18:56 schrieb Prasun
      Kumar:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAM9DqsL1O61K6iKyji+SJDRmoD2WDaQH6yhBVK9ZNsXJtK=7yA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi Ralf,</div>
        <div>I have now hidden the implementation details of DataUpdater
          class on your suggestion using a unique_ptr. <br>
        </div>
      </div>
    </blockquote>
    fine :-)<br>
    <blockquote type="cite"
cite="mid:CAM9DqsL1O61K6iKyji+SJDRmoD2WDaQH6yhBVK9ZNsXJtK=7yA@mail.gmail.com">
      <div dir="ltr">
        <div>How should we proceed on the server side?</div>
        <div>I think you would have to create a directory in files area
          where the updated databases would be hosted. I could then
          update the URL in the code.<br>
        </div>
      </div>
    </blockquote>
    <p>see <a
href="https://sourceforge.net/projects/ktoblzcheck/files/ktoblzcheck-data/">https://sourceforge.net/projects/ktoblzcheck/files/ktoblzcheck-data/</a></p>
    <blockquote type="cite"
cite="mid:CAM9DqsL1O61K6iKyji+SJDRmoD2WDaQH6yhBVK9ZNsXJtK=7yA@mail.gmail.com">
      <div dir="ltr">
        <div> </div>
        <blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px
          solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
          <div>
            <p>As bankdata_dir() points to a read only location (by
              default /usr/share/ktoblzcheck/ on unix like os), there is
              some work required to provide a writeable location, where
              the updater can save the download files and ktoblzcheck
              can read downloaded bankdata files. The rule is to search
              the writeable location first and then, if no file has been
              found, the readonly location. <br>
            </p>
            <p>The writeable location would be on unix like os:
              /home/xxx/.local/share and on windows:
              C:\users\xxx\.local\share where C:\users\xxx can be
              retrieved from the USERPROFILE environment variable.</p>
          </div>
        </blockquote>
        <div>Yes, that sounds good, <br>
        </div>
        <div>But in the <b>current </b>code, the dated_file list is
          populated from the bankdata_dir() first and if no files are
          found then it checks for BANKDATA_PATH. <br>
        </div>
        <div>Is there any reson for this?</div>
      </div>
    </blockquote>
    <p>Yes, bankdata_dir() correlates to the writeable location,
      specified at runtime  and BANKDATA_PATH to the read only location
      specified at comile time. So it looks that bankdata_dir()  needs
      to be changed to support a writeable location. <br>
    </p>
    <div>Also the mentioned dated_file list may be replaced by a public
      function returning all supported bank data pathes to simplify code
      e.g. <br>
    </div>
    <p>    /**<br>
           * Returns the directories where the bankdata may be stored<br>
           * ... The first entry specifies a writeable location.<br>
           *<br>
           * This function was introduced in ktoblzcheck-1.xxx<br>
           */<br>
          static std::vector<std::string>> bankdata_dirs();</p>
    Thanks.
    <blockquote type="cite"
cite="mid:CAM9DqsL1O61K6iKyji+SJDRmoD2WDaQH6yhBVK9ZNsXJtK=7yA@mail.gmail.com">
      <div dir="ltr">
        <div>Prasun<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, 7 Sep 2020 at 03:54,
          Ralf Habacker <<a href="mailto:ralf.habacker@freenet.de"
            moz-do-not-send="true">ralf.habacker@freenet.de</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <div>Am 27.08.20 um 14:53 schrieb Prasun Kumar:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi Ralf,</div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div>A static function in the class
                    AccountNumberCheck::updateDatabase(),<br>
                    which  updates the database when called by the
                    client and returns the <br>
                    state of operation e.g<br>
                    <br>
                      bool AccountNumberCheck::updateDatabase()</div>
                </blockquote>
                <div> </div>
                <div>As suggested here: <a
href="https://mail.kde.org/pipermail/kde-finance-apps/2020-May/000835.html"
                    target="_blank" moz-do-not-send="true">https://mail.kde.org/pipermail/kde-finance-apps/2020-May/000835.html</a></div>
                <div>I have added an API to update databases as a class,
                  'DataUpdater'. I have created a separate class for
                  this</div>
                <div>as the downloading code is too big to put in one
                  method considering modularity and also since these
                  methods were</div>
                <div>independent of the AccountNumberCheck class. The
                  only required method I see now is the bankdata_dir()
                  for downloaded</div>
                <div>file installation but since it's a static method,
                  it can be accessed without any AccountNumberCheck
                  object.</div>
              </div>
            </blockquote>
            <p>As bankdata_dir() points to a read only location (by
              default /usr/share/ktoblzcheck/ on unix like os), there is
              some work required to provide a writeable location, where
              the updater can save the download files and ktoblzcheck
              can read downloaded bankdata files. The rule is to search
              the writeable location first and then, if no file has been
              found, the readonly location. <br>
            </p>
            <p>The writeable location would be on unix like os:
              /home/xxx/.local/share and on windows:
              C:\users\xxx\.local\share where C:\users\xxx can be
              retrieved from the USERPROFILE environment variable.<br>
            </p>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Also, since the class is in the same header file, a
                  client doesn't need to import extra headers, however,
                  they would surely</div>
                <div>need to create a DataUpdater object.<br>
                </div>
              </div>
            </blockquote>
            This looks good except the fact, that there are
            implementation details in the public header, which would
            better to placed into a private class following the hints
            mentioned at <a href="https://herbsutter.com/gotw/_100/"
              target="_blank" moz-do-not-send="true">https://herbsutter.com/gotw/_100/</a>.<br>
            <blockquote type="cite">
              <div dir="ltr">
                <div><br>
                </div>
              </div>
            </blockquote>
            <p>Regards</p>
            <p>Ralf</p>
            <blockquote type="cite">
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Thu, 27 Aug 2020 at
                  12:29, Ralf Habacker <<a
                    href="mailto:ralf.habacker@freenet.de"
                    target="_blank" moz-do-not-send="true">ralf.habacker@freenet.de</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">Am 18.08.20 um
                  06:54 schrieb Prasun Kumar:<br>
                  > Hi mentors,<br>
                  > I have incorporated most of your suggestions into
                  the project and I am <br>
                  > working on the few left.<br>
                  > <br>
                  > The remaining milestones in the proposed project
                  are the creation of API <br>
                  > to integrate the<br>
                  > databases into other applications and the
                  additional subtask of a <br>
                  > download API to fetch<br>
                  > updated databases from a server.<br>
                  > <br>
                  > The downloading API's flow is somewhat clear to
                  me but it would be <br>
                  > helpful to have some pointers<br>
                  > for the first API.<br>
                  > <br>
                  <br>
                  A static function in the class
                  AccountNumberCheck::updateDatabase(),<br>
                  which  updates the database when called by the client
                  and returns the <br>
                  state of operation e.g<br>
                  <br>
                    bool AccountNumberCheck::updateDatabase()<br>
                  <br>
                  or<br>
                  <br>
                  typedef enum {} UpdateState;<br>
                  <br>
                  UpdateState AccountNumberCheck::updateDatabase();<br>
                  <br>
                  <br>
                  Regards<br>
                  Ralf<br>
                </blockquote>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>