Listing 6: WinSTL access shims
/* ///////////////////////////////////////////////////////////// * Extract from winstl_string_access.h * * www: http://winstl.org/ * * Copyright (C) 2002, Synesis Software Pty Ltd. * (Licensed under the Synesis Software Standard Source License: * http://www.synesis.com.au/licenses/ssssl.html) * ////////////////////////////////////////////////////////// */ namespace winstl { template <ws_typename_param_k C> class c_str_ptr_HWND_proxy { public: typedef C char_type; typedef c_str_ptr_HWND_proxy<C> class_type; // Construction public: ws_explicit_k c_str_ptr_HWND_proxy(HWND h); c_str_ptr_HWND_proxy(class_type &rhs); ~c_str_ptr_HWND_proxy(); // Accessors public: operator char_type const *() const; // Implementation . . . // Members protected: char_type *m_buffer; // Not to be implemented protected: void operator =(class_type const &rhs); }; /* HWND */ inline c_str_ptr_HWND_proxy<TCHAR> c_str_ptr(HWND h) { return c_str_ptr_HWND_proxy<TCHAR>(h); } /* LSA_UNICODE_STRING */ inline c_str_ptr_LSA_UNICODE_STRING_proxy c_str_ptr(LSA_UNICODE_STRING const &s) { return c_str_ptr_LSA_UNICODE_STRING_proxy(s); } } // namespace winstl