00001 // These are CL2 specific utilities. 00002 00003 #ifndef __utils_cl2_h__ 00004 #define __utils_cl2_h__ 00005 00006 #include <glib.h> 00007 #include "common/platform_config.h" 00008 00009 G_BEGIN_DECLS 00010 00011 gboolean mkdir_p(const gchar* pathname, GError** error); 00012 00013 gboolean rm_file(const gchar* pathname, GError** error); 00014 00015 gboolean is_ascii_ident(const gchar* s); 00016 00017 #define DECREF(x) { g_object_unref(x); x = NULL; } 00018 #define XDECREF(x) { if (x) DECREF(x) } 00019 00020 #ifdef __cplusplus 00021 #define DELETE_Z(x) { delete x; x = NULL; } 00022 #endif // __cplusplus 00023 00024 #define FREE_Z(_x,_f) { if (_x) { _f(_x); (_x) = NULL; } } 00025 00026 #if !GLIB_CHECK_VERSION(2,14,6) 00027 void g_string_vprintf(GString *string, 00028 const gchar *format, 00029 va_list args); 00030 #endif 00031 00032 #if PRINTF_DOUBLE_BUGGY 00033 // This may produce a GLib OOM error on Symbian. 00034 void g_string_append_printf_fix(GString *gs, 00035 const gchar *fmt, 00036 ...); 00037 gint g_snprintf_fix(gchar *string, 00038 gulong n, 00039 gchar const *format, 00040 ...); 00041 #else 00042 #define g_string_append_printf_fix(arg...) g_string_append_printf(arg) 00043 #define g_snprintf_fix(arg...) g_snprintf(arg) 00044 #endif // PRINTF_DOUBLE_BUGGY 00045 00046 G_END_DECLS 00047 00048 #ifdef __EPOC32__ 00049 #ifdef __cplusplus 00050 00051 /* 00052 !concept {:name => "Double byte string / UTF-8 conversion utilities", 00053 :desc => "A number of different utility functions for conveniently converting between UTF-8 and the native UTF-16 encoding on Symbian."} 00054 */ 00055 00056 #include <e32std.h> 00057 00058 HBufC8* ConvToUtf8ZL(const TDesC& name16); 00059 00060 HBufC8* ConvToUtf8Z(const TDesC& name16); 00061 00062 gchar* ConvToUtf8CStringL(const TDesC& name16); 00063 00064 gchar* ConvToUtf8CString(const TDesC& name16); 00065 00066 int ConvToUtf8CString(gchar* buf, int bufLen, const TDesC& name16); 00067 00068 HBufC* ConvFromUtf8L(const TDesC8& name8); 00069 00070 HBufC* ConvFromUtf8CStringL(const char* s); 00071 00072 #include "common/epoc-session.hpp" 00073 00074 #endif // __cplusplus 00075 #endif // __EPOC32__ 00076 00077 #endif /* __utils_cl2_h__ */ 00078 00079 /** 00080 00081 Copyright 2009 Helsinki Institute for Information Technology (HIIT) 00082 and the authors. All rights reserved. 00083 00084 Authors: Tero Hasu <tero.hasu@hut.fi> 00085 00086 Permission is hereby granted, free of charge, to any person 00087 obtaining a copy of this software and associated documentation files 00088 (the "Software"), to deal in the Software without restriction, 00089 including without limitation the rights to use, copy, modify, merge, 00090 publish, distribute, sublicense, and/or sell copies of the Software, 00091 and to permit persons to whom the Software is furnished to do so, 00092 subject to the following conditions: 00093 00094 The above copyright notice and this permission notice shall be 00095 included in all copies or substantial portions of the Software. 00096 00097 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00098 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00099 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00100 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00101 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00102 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00103 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00104 SOFTWARE. 00105 00106 **/
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:57 2011 by Doxygen 1.6.1