summaryrefslogtreecommitdiff
path: root/library/quuid.cpp
authorzecke <zecke>2002-09-10 12:09:49 (UTC)
committer zecke <zecke>2002-09-10 12:09:49 (UTC)
commit6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4 (patch) (unidiff)
tree6ebc93c6432f4ed9d00ef1448b6a047ef522a79a /library/quuid.cpp
parentd10cddb3c9ce75bc90b14add14bc133737fe35aa (diff)
downloadopie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.zip
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.gz
opie-6b77a1cdb9536b1c135eb86d53a6b2c22c19b0a4.tar.bz2
Qtopia1-6 merge
still to test bic changes to be resolved more changes to be made?
Diffstat (limited to 'library/quuid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/quuid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/quuid.cpp b/library/quuid.cpp
index fb4387c..46fd816 100644
--- a/library/quuid.cpp
+++ b/library/quuid.cpp
@@ -1,100 +1,100 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "quuid.h" 21#include "quuid.h"
22 22
23/*! 23/*!
24 \class QUuid quuid.h 24 \class QUuid quuid.h
25 \brief The QUuid class defines a Universally Unique Identifier (UUID). 25 \brief The QUuid class defines a Universally Unique Identifier (UUID).
26 26
27 This class is temporarily copied from Qt 3.0. 27 This class is temporarily copied from Qt 3.0.
28*/ 28*/
29 29
30/*! 30/*!
31 \fn QUuid::QUuid() 31 \fn QUuid::QUuid()
32 32
33 Creates the null UUID {00000000-0000-0000-0000-000000000000}. 33 Creates the null UUID {00000000-0000-0000-0000-000000000000}.
34*/ 34*/
35 35
36/*! 36/*!
37 \fn QUuid::QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) 37 \fn QUuid::QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
38 38
39 Creates an UUID with the value specified by the parameters, \a l, \a 39 Creates an UUID with the value specified by the parameters, \a l, \a
40 w1, \a w2, \a b1, \a b2, \a b3, \a b4, \a b5, \a b6, \a b7, \a b8. 40 w1, \a w2, \a b1, \a b2, \a b3, \a b4, \a b5, \a b6, \a b7, \a b8.
41 41
42 Example: 42 Example:
43 \code 43 \code
44 // {67C8770B-44F1-410A-AB9A-F9B5446F13EE} 44 // {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
45 QUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee ) 45 QUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee )
46 \endcode 46 \endcode
47*/ 47*/
48 48
49/*! 49/*!
50 \fn QUuid::QUuid( const QUuid &orig ) 50 \fn QUuid::QUuid( const QUuid &orig )
51 51
52 Creates a copy of the QUuid \a orig. 52 Creates a copy of the QUuid \a orig.
53*/ 53*/
54#ifndef QT_NO_QUUID_STRING 54#ifndef QT_NO_QUUID_STRING
55/*! 55/*!
56 Creates a QUuid object from the string \a text. Right now, the function 56 Creates a QUuid object from the string \a text. Right now, the function
57 can only convert the format {12345678-1234-1234-1234-123456789ABC} and 57 can only convert the format {12345678-1234-1234-1234-123456789ABC} and
58 will create the null UUID when the conversion fails. 58 will create the null UUID when the conversion fails.
59*/ 59*/
60QUuid::QUuid( const QString &text ) 60QUuid::QUuid( const QString &text )
61{ 61{
62 bool ok; 62 bool ok;
63 QString temp = text.upper(); 63 QString temp = text.upper();
64 64
65 data1 = temp.mid( 1, 8 ).toULong( &ok, 16 ); 65 data1 = temp.mid( 1, 8 ).toULong( &ok, 16 );
66 if ( !ok ) { 66 if ( !ok ) {
67 *this = QUuid(); 67 *this = QUuid();
68 return; 68 return;
69 } 69 }
70 70
71 data2 = temp.mid( 10, 4 ).toUInt( &ok, 16 ); 71 data2 = temp.mid( 10, 4 ).toUInt( &ok, 16 );
72 if ( !ok ) { 72 if ( !ok ) {
73 *this = QUuid(); 73 *this = QUuid();
74 return; 74 return;
75 } 75 }
76 data3 = temp.mid( 15, 4 ).toUInt( &ok, 16 ); 76 data3 = temp.mid( 15, 4 ).toUInt( &ok, 16 );
77 if ( !ok ) { 77 if ( !ok ) {
78 *this = QUuid(); 78 *this = QUuid();
79 return; 79 return;
80 } 80 }
81 data4[0] = temp.mid( 20, 2 ).toUInt( &ok, 16 ); 81 data4[0] = temp.mid( 20, 2 ).toUInt( &ok, 16 );
82 if ( !ok ) { 82 if ( !ok ) {
83 *this = QUuid(); 83 *this = QUuid();
84 return; 84 return;
85 } 85 }
86 data4[1] = temp.mid( 22, 2 ).toUInt( &ok, 16 ); 86 data4[1] = temp.mid( 22, 2 ).toUInt( &ok, 16 );
87 if ( !ok ) { 87 if ( !ok ) {
88 *this = QUuid(); 88 *this = QUuid();
89 return; 89 return;
90 } 90 }
91 for ( int i = 2; i<8; i++ ) { 91 for ( int i = 2; i<8; i++ ) {
92 data4[i] = temp.mid( 25 + (i-2)*2, 2 ).toUShort( &ok, 16 ); 92 data4[i] = temp.mid( 25 + (i-2)*2, 2 ).toUShort( &ok, 16 );
93 if ( !ok ) { 93 if ( !ok ) {
94 *this = QUuid(); 94 *this = QUuid();
95 return; 95 return;
96 } 96 }
97 } 97 }
98} 98}
99#endif 99#endif
100/*! 100/*!