Re: Patch: Win32EncodingManager implementation


Subject: Re: Patch: Win32EncodingManager implementation
From: Mike Nordell (tamlin@algonet.se)
Date: Wed Apr 11 2001 - 17:50:46 CDT


Dom wrote:
> Can a win32 guy (Paul, Tom, Mike, or Mike) look at this please in the near
> future?

I had a quick look at it, and except for some stylistic issues it seems fine
AFAICT (though I don't use a unicode locale so don't take my word for it). I
haven't tested it yet though.

A few pointers to the OP:

When overriding a virtual function it's often a good idea to include the
"virtual" keyword for documentation purposes.

The mixing of the static char arrays in the implementation (.cpp) file and
letting the class still be created on the heap could create problems,
especially if a user decides to switch locale during a session and the
initilize() method gets called again. If we are not to support such
"hot-switching" perhaps a singleton solution could do the trick? Like:

T& T::instance()
{
    static T the_instance;
    return the_instance;
}

Besides these points it seems fine. Good catch to build in support from
scratch for wide-char version of the API in case we switch to the unicode
APIs.

/Mike



This archive was generated by hypermail 2b25 : Wed Apr 11 2001 - 17:48:52 CDT