crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlUtilities.cs
equal
deleted
inserted
replaced
|
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.Text; |
|
19 using System.IO; |
|
20 using System.Xml; |
|
21 using System.Collections; |
|
22 |
|
23 namespace SymbianUtils.Settings |
|
24 { |
|
25 internal class XmlUtils |
|
26 { |
|
27 public static string ReadAttributeValue( XmlReader aReader, string aAttributeName ) |
|
28 { |
|
29 string ret = string.Empty; |
|
30 ReadAttributeValue( aReader, aAttributeName, out ret ); |
|
31 return ret; |
|
32 } |
|
33 |
|
34 public static void ReadAttributeValue( XmlReader aReader, string aAttributeName, out string aValue ) |
|
35 { |
|
36 aValue = string.Empty; |
|
37 // |
|
38 bool foundName = aReader.MoveToAttribute(aAttributeName); |
|
39 if ( foundName ) |
|
40 { |
|
41 while ( aReader.ReadAttributeValue() ) |
|
42 { |
|
43 aValue += aReader.Value; |
|
44 } |
|
45 } |
|
46 else |
|
47 { |
|
48 throw new Exception( "Could not find attribute \'" + aAttributeName + "\' in xml element" ); |
|
49 } |
|
50 } |
|
51 } |
|
52 } |