FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
August 01, 2003

Generalized String Manipulation: Access Shims and Type Tunneling

(Page 3 of 20)
Listing 10: Type-tunneling via c_str_ptr access shim

Listing 10: Type-tunneling via c_str_ptr access shim

/* /////////////////////////////////////////////////////////////
 * Extract from the Game Framework
 *
 * www:    http://www.gameframework.com/
 *
 * Copyright (C) 2001, 2002, Scott Patterson, Matthew Wilson.
 * (Licensed under the Synesis Software Standard Source License:
 *  http://www.synesis.com.au/licenses/ssssl.html)
 * ////////////////////////////////////////////////////////// */

#ifdef __cplusplus

extern "C"
{
#endif /* __cplusplus */

void GFAssert2A(  gf_char_a_t const   *file
                , int                 line
                , gf_char_a_t const   *expression
                , gf_char_a_t const   *message);
void GFAssert2W( . . . );

#ifdef __cplusplus
} /* extern "C" */

inline void _GFAssert2( gf_char_a_t const   *file
                      , int                 line
                      , gf_char_a_t const   *expression
                      , gf_char_a_t const   *message)
{
  GFAssert2A(file, line, expression, message);
}

inline void _GFAssert2( gf_char_w_t const   *file
                      , int                 line
                      , gf_char_w_t const   *expression
                      , gf_char_w_t const   *message)
{
  GFAssert2W(file, line, expression, message);
}

template <typename S1, typename S2>
inline void GFAssert2 ( gf_char_a_t const   *file
                      , int                 line
                      , S1 const            &expression
                      , S2 const            &message)
{
  _GFAssert2(file, line, c_str_ptr(expression), c_str_ptr(message));
}
#endif /* __cplusplus */

#ifdef __cplusplus
#define GFASSERTMSG(f, sz) \
    ((void)((!(f)) ? GFAssert2(__FILE__, __LINE__, #f, sz) : (0)))
#else
 . . . // C translation must employ character encoding discrimination
#endif /* __cplusplus */

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK