simpleengine/xmlutils/src/simplemeta.cpp
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Simple Engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <s32strm.h>
       
    25 #include <SenBaseElement.h>
       
    26 #include <SenBaseAttribute.h>
       
    27 #include <SenXmlUtils.h>
       
    28 #include <SenXmlReader.h>
       
    29 #include <SenDomFragment.h>
       
    30 
       
    31 // own simple
       
    32 #include "simplecommon.h"
       
    33 #include "simpleelement.h"
       
    34 #include "simplenamespace.h"
       
    35 #include "simpleattribute.h"
       
    36 #include "simplemeta.h"
       
    37 #include "simplebasedocument.h"
       
    38 #include "simpleutils.h"
       
    39 
       
    40 
       
    41 // ================= MEMBER FUNCTIONS =======================
       
    42 //
       
    43 
       
    44 // ----------------------------------------------------------
       
    45 // CSimpleMeta::CSimpleMeta
       
    46 // ----------------------------------------------------------
       
    47 //
       
    48 CSimpleMeta::CSimpleMeta( )
       
    49 : CSimpleBaseDocument()
       
    50     {
       
    51     }
       
    52 
       
    53 // ----------------------------------------------------------
       
    54 // CSimpleMeta::~CSimpleMeta
       
    55 // ----------------------------------------------------------
       
    56 //
       
    57 CSimpleMeta::~CSimpleMeta()
       
    58     {
       
    59     }
       
    60 
       
    61 // ----------------------------------------------------------
       
    62 // CSimpleMeta::ConstructL
       
    63 // ----------------------------------------------------------
       
    64 //
       
    65 void CSimpleMeta::ConstructL(
       
    66     const TDesC8& aNsUri,
       
    67   const TDesC8& aLocalName )
       
    68     {
       
    69     BaseConstructL(aNsUri, aLocalName);
       
    70     }
       
    71 
       
    72 // ----------------------------------------------------------
       
    73 // CSimpleMeta::ConstructL
       
    74 // ----------------------------------------------------------
       
    75 //
       
    76 void CSimpleMeta::ConstructL(
       
    77   const TDesC8& aXml )
       
    78     {
       
    79     BaseConstructL( aXml );
       
    80     }
       
    81 
       
    82 // ----------------------------------------------------------
       
    83 // CSimpleMeta::NewL
       
    84 // ----------------------------------------------------------
       
    85 //
       
    86 CSimpleMeta* CSimpleMeta::NewL( const TDesC8& aXml )
       
    87     {
       
    88     CSimpleMeta* self = new (ELeave) CSimpleMeta( );
       
    89     CleanupStack::PushL( self );
       
    90     self->ConstructL( aXml );
       
    91     CleanupStack::Pop( self );
       
    92     return self;
       
    93     }
       
    94 
       
    95 // ----------------------------------------------------------
       
    96 // CSimpleMeta::ValidateXmlL
       
    97 // ----------------------------------------------------------
       
    98 //
       
    99 void CSimpleMeta::ValidateXmlL( const TDesC8& aName )
       
   100     {
       
   101     if ( aName.CompareF( KRlmiLocalName ) )
       
   102         {
       
   103         User::Leave( KErrCorrupt );
       
   104         }
       
   105     }
       
   106 
       
   107 // ----------------------------------------------------------
       
   108 // CSimpleMeta::DefaultNamespace
       
   109 // ----------------------------------------------------------
       
   110 //
       
   111 TPtrC8 CSimpleMeta::DefaultNamespace()
       
   112     {
       
   113     return CSimpleBaseDocument::DefaultNamespace();
       
   114     }
       
   115 
       
   116 
       
   117 // ----------------------------------------------------------
       
   118 // CSimpleMeta::AddNamespaceL
       
   119 // ----------------------------------------------------------
       
   120 //
       
   121 void CSimpleMeta::AddNamespaceL(
       
   122     const TDesC8& aPrefix,
       
   123     const TDesC8& aUri )
       
   124     {
       
   125     CSimpleBaseDocument::AddNamespaceL( aPrefix, aUri );
       
   126     }
       
   127 
       
   128 // ----------------------------------------------------------
       
   129 // CSimpleMeta::NamespacesL
       
   130 // ----------------------------------------------------------
       
   131 //
       
   132 RPointerArray<MSimpleNamespace>& CSimpleMeta::NamespacesL()
       
   133     {
       
   134     return CSimpleBaseDocument::NamespacesL();
       
   135     }
       
   136 
       
   137 // ----------------------------------------------------------
       
   138 // CSimpleMeta::ExternalizeL
       
   139 // ----------------------------------------------------------
       
   140 //
       
   141 void CSimpleMeta::ExternalizeL( RWriteStream& aStream )
       
   142     {
       
   143     CSimpleBaseDocument::ExternalizeL( aStream );
       
   144     }
       
   145 
       
   146 // ----------------------------------------------------------
       
   147 // CSimpleMeta::Close
       
   148 // ----------------------------------------------------------
       
   149 //
       
   150 void CSimpleMeta::Close()
       
   151     {
       
   152     CSimpleBaseDocument::Close();
       
   153     }
       
   154 
       
   155 // ----------------------------------------------------------
       
   156 // CSimpleMeta::LocalName
       
   157 // ----------------------------------------------------------
       
   158 //
       
   159 const TDesC8& CSimpleMeta::LocalName()
       
   160     {
       
   161     return CSimpleBaseDocument::LocalName();
       
   162     }
       
   163 
       
   164 // ----------------------------------------------------------
       
   165 // CSimpleMeta::DefNamespaceL
       
   166 // ----------------------------------------------------------
       
   167 //
       
   168 MSimpleNamespace* CSimpleMeta::DefNamespaceL()
       
   169     {
       
   170     return CSimpleBaseDocument::DefNamespaceL();
       
   171     }
       
   172 
       
   173 // ----------------------------------------------------------
       
   174 // CSimpleMeta::HasContent
       
   175 // ----------------------------------------------------------
       
   176 //
       
   177 TBool CSimpleMeta::HasContent()
       
   178     {
       
   179     return CSimpleBaseDocument::HasContent();
       
   180     }
       
   181 
       
   182 // ----------------------------------------------------------
       
   183 // CSimpleMeta::ContentUnicodeL
       
   184 // ----------------------------------------------------------
       
   185 //
       
   186 HBufC* CSimpleMeta::ContentUnicodeL()
       
   187     {
       
   188     return CSimpleBaseDocument::ContentUnicodeL();
       
   189     }
       
   190 
       
   191 // ----------------------------------------------------------
       
   192 // CSimpleMeta::SetContentUnicodeL
       
   193 // ----------------------------------------------------------
       
   194 //
       
   195 void CSimpleMeta::SetContentUnicodeL( const TDesC& aContent )
       
   196     {
       
   197     CSimpleBaseDocument::SetContentUnicodeL( aContent );
       
   198     }
       
   199 
       
   200 // ----------------------------------------------------------
       
   201 // CSimpleMeta::SimpleElementsL
       
   202 // ----------------------------------------------------------
       
   203 //
       
   204 TInt CSimpleMeta::SimpleElementsL( RPointerArray<MSimpleElement>& aElementArray )
       
   205     {
       
   206     return CSimpleBaseDocument::SimpleElementsL( aElementArray );
       
   207     }
       
   208 
       
   209 // ----------------------------------------------------------
       
   210 // CSimpleMeta::AttrValueLC
       
   211 // ----------------------------------------------------------
       
   212 //
       
   213 HBufC* CSimpleMeta::AttrValueLC( const TDesC8& aName )
       
   214     {
       
   215     return CSimpleBaseDocument::AttrValueLC( aName );
       
   216     }
       
   217 
       
   218 // ----------------------------------------------------------
       
   219 // CSimpleMeta::AttrValue
       
   220 // ----------------------------------------------------------
       
   221 //
       
   222 const TDesC8* CSimpleMeta::AttrValue( const TDesC8& aName )
       
   223     {
       
   224   return CSimpleBaseDocument::AttrValue( aName );
       
   225     }
       
   226 
       
   227 // ----------------------------------------------------------
       
   228 // CSimpleMeta::AddAttrL
       
   229 // ----------------------------------------------------------
       
   230 //
       
   231 void CSimpleMeta::AddAttrL( const TDesC8& aName, const TDesC& aValue )
       
   232     {
       
   233     CSimpleBaseDocument::AddAttrL( aName, aValue );
       
   234     }
       
   235 
       
   236 // ----------------------------------------------------------
       
   237 // CSimpleMeta::SimpleAttributesL
       
   238 // ----------------------------------------------------------
       
   239 //
       
   240 TInt CSimpleMeta::SimpleAttributesL( RPointerArray<MSimpleAttribute>& aArray )
       
   241     {
       
   242     return CSimpleBaseDocument::SimpleAttributesL( aArray );
       
   243     }
       
   244 
       
   245 // ----------------------------------------------------------
       
   246 // CSimpleMeta::SimpleParentL
       
   247 // ----------------------------------------------------------
       
   248 //
       
   249 MSimpleElement* CSimpleMeta::SimpleParentL()
       
   250     {
       
   251     return CSimpleBaseDocument::SimpleParentL( );
       
   252     }
       
   253 
       
   254 // ----------------------------------------------------------
       
   255 // CSimpleMeta::DetachSimpleL
       
   256 // ----------------------------------------------------------
       
   257 //
       
   258 void CSimpleMeta::DetachSimpleL()
       
   259     {
       
   260     User::Leave( KErrNotFound );
       
   261     }
       
   262 
       
   263 
       
   264 // ----------------------------------------------------------
       
   265 // CSimpleMeta::AddSimpleElementL
       
   266 // ----------------------------------------------------------
       
   267 //
       
   268 MSimpleElement* CSimpleMeta::AddSimpleElementL(
       
   269     const TDesC8& aNsUri,
       
   270     const TDesC8& aLocalName )
       
   271     {
       
   272     return CSimpleBaseDocument::AddSimpleElementL( aNsUri, aLocalName );
       
   273     }
       
   274 
       
   275 // ----------------------------------------------------------
       
   276 // CSimpleMeta::AddSimpleElementL
       
   277 // ----------------------------------------------------------
       
   278 //
       
   279 MSimpleElement* CSimpleMeta::AddSimpleElementL(
       
   280     const TDesC8& aLocalName )
       
   281     {
       
   282     return CSimpleBaseDocument::AddSimpleElementL( aLocalName );
       
   283     }
       
   284 
       
   285 
       
   286 // ----------------------------------------------------------
       
   287 // CSimpleMeta::RemoveSimpleElement
       
   288 // ----------------------------------------------------------
       
   289 //
       
   290 void CSimpleMeta::RemoveSimpleElement(
       
   291     const TDesC8& aNsUri,
       
   292     const TDesC8& aLocalName )
       
   293     {
       
   294     CSimpleBaseDocument::RemoveSimpleElement( aNsUri, aLocalName );
       
   295     }
       
   296 
       
   297 
       
   298 
       
   299