crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethodParameter.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using SymbianUtils.SourceParser.Objects;
       
    21 
       
    22 namespace SymbianUtils.SourceParser.Parsers
       
    23 {
       
    24     public class ParserSrcMethodParameter
       
    25     {
       
    26         #region Constructors
       
    27         public ParserSrcMethodParameter()
       
    28         {
       
    29         }
       
    30         #endregion
       
    31 
       
    32         #region API
       
    33         public void Parse( ref string aText, SrcMethod aMethod )
       
    34         {
       
    35             /*
       
    36              * TPtrC16::TPtrC16(const unsigned short*) 
       
    37              * TPtrC16::TPtrC16(const TDesC16&) 
       
    38              * UserHal::MemoryInfo(TDes8&) 
       
    39              * RHandleBase::Close() 
       
    40              * TBufCBase16::Copy(const TDesC16&, int) 
       
    41              * CBufFlat::NewL(int) 
       
    42              * TBufCBase16::TBufCBase16() 
       
    43              * CServer2::RunL() 
       
    44              * CServer2::StartL(const TDesC16&) 
       
    45              * CServer2::DoCancel() 
       
    46              * CServer2::RunError(int) 
       
    47              * CServer2::DoConnect(const RMessage2&) 
       
    48              * CServer2::CServer2__sub_object(int, CServer2::TServerType) 
       
    49              */
       
    50             string paramType = string.Empty;
       
    51             while ( aText.Length > 0 )
       
    52             {
       
    53                 int commaPos = aText.IndexOf( "," );
       
    54                 //
       
    55                 paramType = aText;
       
    56                 if ( commaPos > 0 )
       
    57                 {
       
    58                     paramType = aText.Substring( 0, commaPos ).Trim();
       
    59                     if ( commaPos < aText.Length )
       
    60                         aText = aText.Substring( commaPos + 1 ).Trim();
       
    61                     else
       
    62                         aText = string.Empty;
       
    63                 }
       
    64                 else
       
    65                 {
       
    66                     // Everything was consumed
       
    67                     aText = string.Empty;
       
    68                 }
       
    69 
       
    70                 // Should have the parameter same now. Make a new parameter
       
    71                 SrcMethodParameter parameter = new SrcMethodParameter();
       
    72                 parameter.Name = paramType;
       
    73                 aMethod.AddParameter( parameter );
       
    74             }
       
    75         }
       
    76         #endregion
       
    77 
       
    78         #region Properties
       
    79         #endregion
       
    80 
       
    81         #region Data members
       
    82         #endregion
       
    83     }
       
    84 }