StringConverter< char_type > Struct Template Reference
 
 
 
StringConverter< char_type > Struct Template Reference

#include <StringConverter.h>

template<typename char_type>
struct ManagedServices::StringConverter< char_type >

Classes

struct   TstrPicker
struct   TstrPicker< char >
struct   TstrPicker< wchar_t >

Public Types

typedef char_type *  converted_type

Public Member Functions

char_type *  Convert (System::String^in)

Member Typedef Documentation


Member Function Documentation

char_type* Convert ( System::String^  in ) [inline]
        {
                // This should all be const, but INode methods are not const-correct
                // Rather than jump through hoops to use const_casting wrapper functors,
                // I'm stripping off the const here.

                pin_ptr<const wchar_t> pinned( PtrToStringChars(in) );
                mString = mString.FromUTF16(static_cast<const wchar_t*>(pinned));
                return const_cast<char_type*>(mString.data());
        }