1 /*
2     Kopete Oscar Protocol
3     oscartypeclasses.cpp - Oscar Type Definitions
4 
5     Copyright (c) 2004 Matt Rogers <mattr@kde.org>
6 
7     Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
8 
9     *************************************************************************
10     *                                                                       *
11     * This library is free software; you can redistribute it and/or         *
12     * modify it under the terms of the GNU Lesser General Public            *
13     * License as published by the Free Software Foundation; either          *
14     * version 2 of the License, or (at your option) any later version.      *
15     *                                                                       *
16     *************************************************************************
17 */
18 
19 #include "oscartypeclasses.h"
20 #include <QList>
21 #include <kdebug.h>
22 #include "oscarutils.h"
23 #include "buffer.h"
24 
25 // using namespace Oscar;
26 
TLV()27 Oscar::TLV::TLV()
28 :type(0), length(0)
29 {
30 }
31 
TLV(quint16 newType,quint16 newLength,char * newData)32 Oscar::TLV::TLV( quint16 newType, quint16 newLength, char* newData )
33 :type( newType ), length( newLength ), data( QByteArray( newData, length ) )
34 {
35 }
36 
TLV(quint16 newType,quint16 newLength,const QByteArray & newData)37 Oscar::TLV::TLV( quint16 newType, quint16 newLength, const QByteArray& newData )
38 :type( newType ), length( newLength ), data( newData )
39 {
40 }
41 
TLV(const TLV & t)42 Oscar::TLV::TLV( const TLV& t )
43 :type( t.type ), length( t.length ), data( t.data )
44 {
45 }
46 
operator bool() const47 Oscar::TLV::operator bool() const
48 {
49 	return type != 0;
50 }
51 
52 //kate: indent-mode csands;
53