bluetooth/btsdp/database/MSdpElementBuilder.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #include <btsdp.h>
       
    18 #include "mignorer.h"
       
    19 
       
    20 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildUnknownL(TUint8 /*aType*/, TUint8 /*aSizeDesc*/, const TDesC8& /*aData*/)
       
    21 /** Adds an element of any type.
       
    22 
       
    23 @param aType Type descriptor
       
    24 @param aSizeDesc Size descriptor
       
    25 @param aData Data field
       
    26 @return Builder with added element */
       
    27 	{
       
    28 	User::Leave(KErrGeneral);
       
    29 	return 0;
       
    30 	}
       
    31 
       
    32 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildNilL()
       
    33 /** Adds a null element.
       
    34 
       
    35 @return Builder with added element */
       
    36 	{
       
    37 	User::Leave(KErrGeneral);
       
    38 	return 0;
       
    39 	}
       
    40 
       
    41 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildUintL(const TDesC8& /*aUint*/)
       
    42 /** Adds an unsigned integer element.
       
    43 
       
    44 @param aUint Element to add
       
    45 @return Builder with added element */
       
    46 	{
       
    47 	User::Leave(KErrGeneral);
       
    48 	return 0;
       
    49 	}
       
    50 
       
    51 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildIntL(const TDesC8& /*aInt*/)
       
    52 /** Adds a signed integer element.
       
    53 
       
    54 @param aInt Element to add
       
    55 @return Builder with added element */
       
    56 	{
       
    57 	User::Leave(KErrGeneral);
       
    58 	return 0;
       
    59 	}
       
    60 
       
    61 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildUUIDL(const TUUID& /*aUUID*/)
       
    62 /** Adds a UUID element.
       
    63 
       
    64 @param aUUID Element to add
       
    65 @return Builder with added element */
       
    66 	{
       
    67 	User::Leave(KErrGeneral);
       
    68 	return 0;
       
    69 	}
       
    70 
       
    71 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildBooleanL(TBool /*aBool*/)
       
    72 /** Adds a Boolean element.
       
    73 
       
    74 @param aBool Element to add
       
    75 @return Builder with added element */
       
    76 	{
       
    77 	User::Leave(KErrGeneral);
       
    78 	return 0;
       
    79 	}
       
    80 
       
    81 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildStringL(const TDesC8& /*aString*/)
       
    82 /** Adds a Text String element.
       
    83 
       
    84 @param aString Element to add
       
    85 @return Builder with added element */
       
    86 	{
       
    87 	User::Leave(KErrGeneral);
       
    88 	return 0;
       
    89 	}
       
    90 
       
    91 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildDESL()
       
    92 /** Adds a (header for a) Data element sequence (DES), a data element 
       
    93 whose data field is a sequence of data elements.
       
    94 
       
    95 This should be followed by a call to StartListL(), and then calls to add elements 
       
    96 to the list.
       
    97 
       
    98 @return Attribute value with added element */
       
    99 	{
       
   100 	User::Leave(KErrGeneral);
       
   101 	return 0;
       
   102 	}
       
   103 
       
   104 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildDEAL()
       
   105 /** Adds a (header for a) Data element alternative (DEA), a data element 
       
   106 whose data field is a sequence of data elements from which one data element 
       
   107 is to be selected.
       
   108 
       
   109 This should be followed by a call to StartListL(), and then calls to add elements 
       
   110 to the list.
       
   111 
       
   112 @return Attribute value with added element */
       
   113 	{
       
   114 	User::Leave(KErrGeneral);
       
   115 	return 0;
       
   116 	}
       
   117 
       
   118 /** Tell builder you are about to start a list
       
   119 
       
   120 @return Builder */
       
   121 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::StartListL()
       
   122 /** Indicates that subsequent elements added belong to a DES or DEA.
       
   123 
       
   124 The end of the list should be indicated by a call to EndList().
       
   125 
       
   126 @return Builder */
       
   127 	{
       
   128 	User::Leave(KErrGeneral);
       
   129 	return 0;
       
   130 	}
       
   131 
       
   132 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::EndListL()
       
   133 /** Indicates that subsequent elements no longer belong to current DES or DEA
       
   134 
       
   135 Building of current DES or DEA is terminated.
       
   136 @return Builder */
       
   137 	{
       
   138 	User::Leave(KErrGeneral);
       
   139 	return 0;
       
   140 	}
       
   141 
       
   142 EXPORT_C MSdpElementBuilder* MSdpElementBuilder::BuildURLL(const TDesC8& /*aString*/)
       
   143 /** Adds a URL element.
       
   144 
       
   145 @param aURL Element to add
       
   146 @return Builder with added element */
       
   147 	{
       
   148 	User::Leave(KErrGeneral);
       
   149 	return 0;
       
   150 	}
       
   151 	
       
   152 /**
       
   153 This virtual function allows the M- classes to be extended in future in a binary
       
   154 compatible way by providing a method that clients can override in future to
       
   155 allow extra callbacks to be made via aObject.
       
   156 */	
       
   157 EXPORT_C void MSdpElementBuilder::MSEB_ExtensionInterfaceL(TUid /*aInterface*/, void*& aObject)
       
   158 	{
       
   159 	aObject = NULL;
       
   160 	}
       
   161 
       
   162 // opposite, ignores everything
       
   163 
       
   164 MSdpElementBuilder* MIgnorer::BuildUnknownL(TUint8 /*aType*/, TUint8 /*aSizeDesc*/, const TDesC8& /*aData*/)
       
   165 	{
       
   166 	return this;
       
   167 	}
       
   168 
       
   169 MSdpElementBuilder* MIgnorer::BuildNilL()
       
   170 	{
       
   171 	return this;
       
   172 	}
       
   173 
       
   174 MSdpElementBuilder* MIgnorer::BuildUintL(const TDesC8& /*aUint*/)
       
   175 	{
       
   176 	return this;
       
   177 	}
       
   178 
       
   179 MSdpElementBuilder* MIgnorer::BuildIntL(const TDesC8& /*aInt*/)
       
   180 	{
       
   181 	return this;
       
   182 	}
       
   183 
       
   184 MSdpElementBuilder* MIgnorer::BuildUUIDL(const TUUID& /*aUUID*/)
       
   185 	{
       
   186 	return this;
       
   187 	}
       
   188 
       
   189 MSdpElementBuilder* MIgnorer::BuildBooleanL(TBool /*aBool*/)
       
   190 	{
       
   191 	return this;
       
   192 	}
       
   193 
       
   194 MSdpElementBuilder* MIgnorer::BuildStringL(const TDesC8& /*aString*/)
       
   195 	{
       
   196 	return this;
       
   197 	}
       
   198 
       
   199 MSdpElementBuilder* MIgnorer::BuildDESL()
       
   200 	{
       
   201 	return this;
       
   202 	}
       
   203 
       
   204 MSdpElementBuilder* MIgnorer::BuildDEAL()
       
   205 	{
       
   206 	return this;
       
   207 	}
       
   208 
       
   209 MSdpElementBuilder* MIgnorer::StartListL()
       
   210 	{
       
   211 	return this;
       
   212 	}
       
   213 
       
   214 MSdpElementBuilder* MIgnorer::EndListL()
       
   215 	{
       
   216 	return this;
       
   217 	}
       
   218 
       
   219 MSdpElementBuilder* MIgnorer::BuildURLL(const TDesC8& /*aString*/)
       
   220 	{
       
   221 	return this;
       
   222 	}
       
   223 
       
   224 //MSdpElementBuilder* MIgnorer::BuildEncodedL(const TDesC8& /*aString*/)
       
   225 //	{
       
   226 //	return this;
       
   227 //	}