sl@0: /*************************************************************************** sl@0: * sl@0: * any.h - definition of the rw_any_t class sl@0: * sl@0: * $Id: any.h 290028 2005-09-19 00:25:26Z sebor $ sl@0: * sl@0: *************************************************************************** sl@0: * sl@0: * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave sl@0: * Software division. Licensed under the Apache License, Version 2.0 (the sl@0: * "License"); you may not use this file except in compliance with the sl@0: * License. You may obtain a copy of the License at sl@0: * http://www.apache.org/licenses/LICENSE-2.0. Unless required by sl@0: * applicable law or agreed to in writing, software distributed under sl@0: * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR sl@0: * CONDITIONS OF ANY KIND, either express or implied. See the License sl@0: * for the specific language governing permissions and limitations under sl@0: * the License. sl@0: * sl@0: **************************************************************************/ sl@0: sl@0: #ifndef RW_ANY_H_INCLUDED sl@0: #define RW_ANY_H_INCLUDED sl@0: sl@0: sl@0: #include sl@0: #ifdef __SYMBIAN32__ sl@0: #include sl@0: #endif //__SYMBIAN32__ sl@0: sl@0: class rw_any_t sl@0: { sl@0: public: sl@0: sl@0: #ifndef _RWSTD_NO_BOOL sl@0: _TEST_EXPORT rw_any_t (bool); sl@0: #endif // _RWSTD_NO_BOOL sl@0: sl@0: _TEST_EXPORT rw_any_t (char); sl@0: _TEST_EXPORT rw_any_t (signed char); sl@0: _TEST_EXPORT rw_any_t (unsigned char); sl@0: sl@0: _TEST_EXPORT rw_any_t (signed short); sl@0: _TEST_EXPORT rw_any_t (unsigned short); sl@0: sl@0: _TEST_EXPORT rw_any_t (signed int); sl@0: _TEST_EXPORT rw_any_t (unsigned int); sl@0: sl@0: _TEST_EXPORT rw_any_t (signed long); sl@0: _TEST_EXPORT rw_any_t (unsigned long); sl@0: sl@0: #ifdef _RWSTD_LONG_LONG sl@0: _TEST_EXPORT rw_any_t (signed _RWSTD_LONG_LONG); sl@0: _TEST_EXPORT rw_any_t (unsigned _RWSTD_LONG_LONG); sl@0: #endif // _RWSTD_LONG_LONG sl@0: sl@0: _TEST_EXPORT rw_any_t (float); sl@0: _TEST_EXPORT rw_any_t (double); sl@0: sl@0: #ifndef _RWSTD_NO_LONG_DOUBLE sl@0: _TEST_EXPORT rw_any_t (long double); sl@0: #endif // _RWSTD_NO_LONG_DOUBLE sl@0: sl@0: _TEST_EXPORT rw_any_t (const void*); sl@0: _TEST_EXPORT rw_any_t (const char*); sl@0: sl@0: #ifndef _RWSTD_NO_NATIVE_WCHAR_T sl@0: _TEST_EXPORT rw_any_t (wchar_t); sl@0: #endif // _RWSTD_NO_NATIVE_WCHAR_T sl@0: sl@0: #ifndef _RWSTD_NO_WCHAR_T sl@0: _TEST_EXPORT rw_any_t (const wchar_t*); sl@0: #endif // _RWSTD_NO_WCHAR_T sl@0: sl@0: _TEST_EXPORT rw_any_t (const rw_any_t&); sl@0: sl@0: _TEST_EXPORT ~rw_any_t (); sl@0: sl@0: _TEST_EXPORT rw_any_t& operator= (const rw_any_t&); sl@0: sl@0: _TEST_EXPORT const char* tostr (const char* = 0); sl@0: _TEST_EXPORT const char* type_name () const; sl@0: sl@0: enum type_id_t { sl@0: t_none, sl@0: t_bool, t_schar, t_uchar, t_char, sl@0: t_sshrt, t_ushrt, t_sint, t_uint, t_slong, t_ulong, sl@0: t_sllong, t_ullong, sl@0: t_flt, t_dbl, t_ldbl, sl@0: t_wchar, sl@0: t_pvoid, sl@0: t_str, sl@0: t_wstr sl@0: }; sl@0: sl@0: private: sl@0: sl@0: union uval_t { sl@0: sl@0: #ifndef _RWSTD_NO_LONG_DOUBLE sl@0: long double ldbl_; sl@0: #endif // _RWSTD_NO_LONG_DOUBLE sl@0: const void *pvoid_; sl@0: double dbl_; sl@0: #ifdef _RWSTD_LONG_LONG sl@0: signed _RWSTD_LONG_LONG sllong_; sl@0: unsigned _RWSTD_LONG_LONG ullong_; sl@0: #endif // _RWSTD_LONG_LONG sl@0: float flt_; sl@0: #ifndef _RWSTD_NO_NATIVE_WCHAR_T sl@0: wchar_t wchar_; sl@0: #endif // _RWSTD_NO_NATIVE_WCHAR_T sl@0: signed long slong_; sl@0: unsigned long ulong_; sl@0: signed int sint_; sl@0: unsigned int uint_; sl@0: signed short sshrt_; sl@0: unsigned short ushrt_; sl@0: signed char schar_; sl@0: unsigned char uchar_; sl@0: char char_; sl@0: #ifndef _RWSTD_NO_BOOL sl@0: bool bool_; sl@0: #endif // _RWSTD_NO_BOOL sl@0: } val_; sl@0: sl@0: char *str_; sl@0: type_id_t tid_; sl@0: }; sl@0: sl@0: sl@0: #define TOSTR(x) rw_any_t (x).tostr () sl@0: sl@0: sl@0: #endif // RW_ANY_H_INCLUDED