Designing libiconvpp library

I have continued my old postponed work for creating the good C++ interface for the libiconv. I want the library to be working without manually allocating buffers and controlling the conversation flow. I'd prefer simple interface like "do all needed for converting this into that".

I have procrastinated completing the library after succeding with dirty brute-forcing the functionality of functions:

std::wstring convert(const std::string & pFrom);
std::string convert(const std::wstring & pFrom);

I like this good C++ interface, but it have awfull implementation. Both of this functions are copy-paste of each other, using that lowest-level iconv() function. There is no clever memory allocations, it just allocates twice amount of the source buffer size. I have stucked with expanding the library this way.

Now I'm going another way. I have splitted my task into:

  • Decrease complexity of the original C interface by creating the wrapper over the conversion descriptor. This will hide low-level stuff like iconv_open, iconv_close and error processing into something more human-friendly, but will leave the conversion workflow as it is now (several calls to the iconv() function, manually handling the buffer management).
  • Create helper classes for automatic buffer allocation and management during the conversion, allowing converting the data in single method call and hiding old plain calling a sequence of iconv() function inside of that method.
  • A bunch of simplified things like those two functions I have mentioned in the beginning of this text.

I'm going to release the result as opensource.