<div dir="ltr"><div>Hi Thomas,</div><div>Thanks for answering.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I think turning the member var into a std::string is a viable solution.<br>
I scanned briefly over the source and found important use of the numeric<br>
variant only in the "German" sections of it.</div></blockquote><div><br></div><div>I thought that was the better idea too. Initially, I was looking for alternate ways because of the API design</div><div>principles of avoiding modifications in a public API. However, I think if the ctors and other methods are</div><div>adjusted accordingly, it would not impact anyone dependent on the API.</div><div><br></div><div>Thanks for the insight.</div><div>Prasun<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 Aug 2020 at 11:50, Thomas Baumgart <<a href="mailto:thb@net-bembel.de">thb@net-bembel.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">Hi Prasun,<br>
<br>
On Sonntag, 16. August 2020 07:31:03 CEST Prasun Kumar wrote:<br>
<br>
> Hi mentors,<br>
> The Record class has member 'bankId' of type unsigned long. However, in the<br>
> case of the Netherlands,<br>
> the bankID is a string due to which it is not working correctly. Should I<br>
> create another class named NL_Record<br>
> or something similar to handle Netherlands records? Alternatively, I could<br>
> just expand the 4 character bankID of<br>
> Netherlands into a long integer but that feels sort of like a hack and not<br>
> a solution.<br>
> Please let me know if there is a good way to handle this.<br>
<br>
I think turning the member var into a std::string is a viable solution.<br>
I scanned briefly over the source and found important use of the numeric<br>
variant only in the "German" sections of it. One thing I would not touch are<br>
the check functions, but they can be called with<br>
<br>
return (iter2->second)(account, weight, accountId, atol(bankId));<br>
<br>
instead of<br>
<br>
return (iter2->second)(account, weight, accountId, bankId);<br>
<br>
You may get rid of the ctor using the unsigned long as argument. Have not checked<br>
where it is used. A ctor providing a char* as argument already exists.<br>
<br>
One thing you need to change is the definition of the map containing pointers<br>
to the Records, which uses the ulong as key. This also needs to be changed and<br>
all the code using it, but should be straight forward.<br>
<br>
I would vote against using a special object (as in NL_Record).<br>
<br>
On a side note: using constructs like<br>
<br>
if (country == "DE")<br>
else if(country == "NL")<br>
else if ...<br>
<br>
usually calls for a base class and some special derivatives and a set of<br>
virtual methods that do the specialization. But that change is maybe<br>
something for another project.<br>
<br>
<br>
Hope that helps.<br>
<br>
-- <br>
<br>
Regards<br>
<br>
Thomas Baumgart<br>
<br>
<a href="https://www.signal.org/" rel="noreferrer" target="_blank">https://www.signal.org/</a> Signal, the better WhatsApp<br>
-------------------------------------------------------------<br>
'rm -rf' is a short-hand for 'read manual really fast'<br>
-------------------------------------------------------------<br>
</blockquote></div>