Have you looked at how various standard library implementations do this for std::string? It should be a pretty analogous process.
Looking through GCC's implementation, running into the problem that it handles everything through locales, and such; this runs the issue that the custom traits class can essentially define its own locale, so the standard library attempting to convert code units to code points (or the opposite direction) before it ever reaches me is a problem. This subverts what I am doing, and thus, I must try to read raw data, since the format might be one that the custom string expects, but not one that std::basic_stream and the standard locales would.
Also, it seems that Windows internally converts wchar_t string to a char stream using ANSI codepages, so I can imagine that it'd butcher my data if I outputted data from different locales through the same stream. My point is, I feel like the standard implementation might be barking up the wrong tree, if I, for example, want to implement outputting UTF-16 data, assuming that the OS doesn't have built-in UTF-16 support.
as ApochPiQ mentioned, the standard templated std::string method is basically what you are after. If that seems a bit of a hurdle to wade through, a google search of "overloading << operator c++" came back with a "couple" results, like:
I do have an overload for the operators, I'm wondering how to implement it properly. You might notice that the link does not modify the behavior of reading in the data; rather it just batches together a couple standard operations. What I'm doing does not adhere to the conventional idea of a character, so I can't just std::cin >> str.char_array.