connectivitymodules/SeCon/servers/syncserver/inc/logdatastoreformat.h
branchRCL_3
changeset 19 0aa8cc770c8a
parent 18 453dfc402455
child 20 4a793f564d72
equal deleted inserted replaced
18:453dfc402455 19:0aa8cc770c8a
     1 /*
       
     2 * Copyright (c) 2010 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 class for tracing datastore format
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOGDATASTOREFORMAT_H_
       
    19 #define LOGDATASTOREFORMAT_H_
       
    20 
       
    21 //
       
    22 #include "debug.h"
       
    23 
       
    24 NONSHARABLE_CLASS(TLogDataStoreFormat)
       
    25     {
       
    26     public:
       
    27 #ifndef _DEBUG
       
    28 // does nothing on release version
       
    29 static void TLogDataStoreFormat::LogDataStoreFormatL( const TDesC& /*aLogInfo*/, const CSmlDataStoreFormat& /*aDataStoreFormat*/ )
       
    30     {
       
    31     }
       
    32 #else
       
    33 static void TLogDataStoreFormat::LogDataStoreFormatL( const TDesC& aLogInfo, const CSmlDataStoreFormat& aDataStoreFormat )
       
    34     {
       
    35     LOGGER_WRITE_1("LogDataStoreFormatL, aLogInfo: %S", &aLogInfo);
       
    36     LOGGER_WRITE_1("DisplayName: %S", &aDataStoreFormat.DisplayName());
       
    37     TBool hasMaxSize = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHasMaxSize );
       
    38     TBool hasMaxItems = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHasMaxItems );
       
    39     TBool hierarcial = aDataStoreFormat.IsSupported( CSmlDataStoreFormat::EOptionHierarchial );
       
    40     LOGGER_WRITE_1("hasMaxSize: %d", (TInt)hasMaxSize);
       
    41     LOGGER_WRITE_1("hasMaxItems: %d", (TInt)hasMaxItems);
       
    42     LOGGER_WRITE_1("hierarcial: %d", (TInt)hierarcial);
       
    43     LOGGER_WRITE_1("MimeFormatCount: %d", aDataStoreFormat.MimeFormatCount());
       
    44     for ( TInt i = 0; i < aDataStoreFormat.MimeFormatCount(); i++)
       
    45         {
       
    46         LOGGER_WRITE_1("  MimeFormat(%d)",i);
       
    47         const CSmlMimeFormat& mimeformat = aDataStoreFormat.MimeFormat(i);
       
    48         LOGGER_WRITE8_1("  MimeType: %S", &mimeformat.MimeType().DesC());
       
    49         LOGGER_WRITE8_1("  MimeVersion: %S", &mimeformat.MimeVersion().DesC());
       
    50         LOGGER_WRITE_1( "  FieldLevel, bool: %d", (TInt) mimeformat.FieldLevel());
       
    51         LOGGER_WRITE_1( "  PropertyCount: %d", mimeformat.PropertyCount());
       
    52         for ( TInt j=0; j<mimeformat.PropertyCount(); j++ )
       
    53             {
       
    54             LOGGER_WRITE_1("    MimeFormat property(%d)",j);
       
    55             const CSmlDataProperty& dataProp = mimeformat.Property(j);
       
    56             const CSmlDataField& dataField = dataProp.Field();
       
    57             LOGGER_WRITE8_1("    dataField: %S", &dataField.Name().DesC());
       
    58             LOGGER_WRITE_1( "    DisplayName: %S", &dataField.DisplayName());
       
    59             LOGGER_WRITE_1( "    HasMaxSize: %d", (TInt)dataProp.HasMaxSize());
       
    60             LOGGER_WRITE_1( "    MaxSize: %d", dataProp.MaxSize());
       
    61             LOGGER_WRITE_1( "    HasMaxOccur: %d", (TInt)dataProp.HasMaxOccur());
       
    62             LOGGER_WRITE_1( "    MaxOccur: %d", dataProp.MaxOccur());
       
    63             TBool OptionNoTruncate = dataProp.IsSupported(CSmlDataProperty::EOptionNoTruncate);
       
    64             LOGGER_WRITE_1( "    EOptionNoTruncate: %d", (TInt)OptionNoTruncate);
       
    65             LOGGER_WRITE8_1("    DataType(): %S", &dataField.DataType().DesC());
       
    66             LOGGER_WRITE_1( "    EnumValueCount(): %d", dataField.EnumValueCount());
       
    67             for ( TInt k=0; k<dataField.EnumValueCount(); k++)
       
    68                 {
       
    69                 LOGGER_WRITE8_1("      EnumValue(): %S", &dataField.EnumValue(k).DesC());
       
    70                 }
       
    71             LOGGER_WRITE_1("    ParamCount: %d", dataProp.ParamCount());
       
    72             for ( TInt k=0; k<dataProp.ParamCount(); k++)
       
    73                 {
       
    74                 LOGGER_WRITE_1( "      dataParamField(%d)", k);
       
    75                 const CSmlDataPropertyParam& param = dataProp.Param(k);
       
    76                 const CSmlDataField& field = param.Field();
       
    77                 LOGGER_WRITE8_1("      dataParamField: %S", &field.Name().DesC());
       
    78                 LOGGER_WRITE_1( "      dataParamDisplayName: %S", &field.DisplayName());
       
    79                 LOGGER_WRITE8_1("      dataParamDataType(): %S", &field.DataType().DesC());
       
    80                 LOGGER_WRITE_1( "      dataParamEnumValueCount(): %d", field.EnumValueCount());
       
    81                 for ( TInt l=0; l<field.EnumValueCount(); l++)
       
    82                     {
       
    83                     LOGGER_WRITE8_1("        dataParamEnumValue(): %S", &field.EnumValue(l).DesC());
       
    84                     }
       
    85                 
       
    86                 LOGGER_WRITE("      ---------------");
       
    87                 }
       
    88             LOGGER_WRITE(   "    -----------------");
       
    89             }
       
    90         
       
    91         LOGGER_WRITE(   "  -----------------");
       
    92         }
       
    93     }
       
    94 #endif
       
    95     };
       
    96 
       
    97 
       
    98 #endif /* LOGDATASTOREFORMAT_H_ */