Hi,
I am new to this project to checkout code so I started out looking at your code but do not have the full picture yet so bare with me if I have misunderstood something in your code.
– BDecoder.cpp –
p.binaryReader = new BinaryReader
[1] why not use auto_ptr ? - in general it seems auto_ptr is not used, I think it is a must-have for all allocations (part from arrays of course) so that you always have clear owners of any allocated objects.
if (ch > ‘0′ && ch
[2] it is more correct to use “isdigit( ch )” from include instead
return new BErrorItem();
[3] here is an example where I would use an auto_ptr instead. By doing so, you force the caller of the function to take ownership of any returned object. i.e. if the return type of the function is an auto_ptr.
[4] it is not good writing “new classname()” instead “new classname” is better to avoid accidentally mistaking a function call with an allocation
[5] when returning an error BErrorItem why not give more information about the error ? instead of just “there was some error” It makes tracking down errors easier.
BItem *key, *value;
[6] should be moved inside loop below where they are used.
[7] There is no virtual destructor but it is used to inherit from. I would recommend using the standard way of doing classes so that all cases are covered i.e. have a default ctor, dtor, assignment and default copy constructor etc. The reason for this is when doing classes that other people should use, one must expect they are not familiar with the internals of a class to avoid them using the class in a wrong way it is important to tailor the class in a foolproof way.
– BDictionary.cpp –
[8] Generally speaking any class that is inherited from should have a virtual destructor. In your BItem you don’t have a virtual _dtor.
[9] Why are not functions encapsuled in try/catch. In general there seems to be lacking exception and error handling. Best is to detect errors as soon as possible and not ignore anything.
HTH/AJK.
