xref: /aoo41x/main/sal/osl/all/utility.cxx (revision 79aad27f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sal.hxx"
26 
27 
28 #include "rtl/ustring.hxx"
29 #include "osl/time.h"
30 #include <stdio.h>
31 
32 
33 /*
34  *   mfe : maybe it would be wishful to include initialization
35  *         of the global timer in dllmain or _init directly.
36  *         But noneoftheless this (should) work too.
37  */
38 namespace osl
39 {
40 
41 class OGlobalTimer
42 {
43 
44 public:
45 
OGlobalTimer()46     OGlobalTimer() {
47         getTime();
48     }
49 
getTime()50     sal_uInt32 getTime()
51     {
52         return osl_getGlobalTimer();
53     }
54 
55 
56 };
57 
58 static OGlobalTimer aGlobalTimer;
59 
60 }
61 
62 
63 extern "C"
64 {
debug_ustring(rtl_uString * ustr)65 void debug_ustring(rtl_uString* ustr)
66 {
67     sal_Char* psz=0;
68     rtl_String* str=0;
69 
70     if ( ustr != 0 )
71     {
72         rtl_uString2String( &str,
73                             rtl_uString_getStr(ustr),
74                             rtl_uString_getLength(ustr),
75                             RTL_TEXTENCODING_UTF8,
76                             OUSTRING_TO_OSTRING_CVTFLAGS );
77 
78         psz = rtl_string_getStr(str);
79     }
80 
81     fprintf(stderr,"'%s'\n",psz);
82 
83     if ( str != 0 )
84     {
85         rtl_string_release(str);
86     }
87 
88     return;
89 }
90 
91 }
92 
debug_oustring(rtl::OUString & ustr)93 void debug_oustring(rtl::OUString& ustr)
94 {
95 
96 	debug_ustring(ustr.pData);
97 
98 	return;
99 }
100