|
1 // Copyright (c) 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 // parse.h |
|
15 // |
|
16 /** |
|
17 * @file parse.h |
|
18 * |
|
19 * @internalComponent |
|
20 * @released |
|
21 */ |
|
22 #ifndef __PARSE_H__ |
|
23 #define __PARSE_H__ |
|
24 |
|
25 #include <iostream> |
|
26 #include <string> |
|
27 #include "commontypes.h" |
|
28 using namespace std; |
|
29 |
|
30 #define KUidAppRegistrationResourceFile 0x101f8021 |
|
31 |
|
32 //Local function to Copy TUint16 |
|
33 void BufCpy(TUint16* aTemp1,TUint16* aTemp2, TInt aLength); |
|
34 //Local function to Copy TUint8 |
|
35 void BufCpy8(TUint8* aTemp1, const TUint8* aTemp2, TInt aLength); |
|
36 //Find if wild character present in the input string |
|
37 TInt FindWild(PtrC16 *aPtr); |
|
38 //Find if wild character present in the input string |
|
39 TInt FindWild(std::string& aRegistrationFileDrive, std::string& aAppFilePath, std::string& aAppFileNameAndExt); |
|
40 |
|
41 std::string FullNameWithoutDrive(std::string& Buf ); |
|
42 |
|
43 /** |
|
44 * Converts from Ptr8* datatype to wstring |
|
45 */ |
|
46 std::wstring Ptr8ToWstring(const Ptr8* aBuf); |
|
47 /** |
|
48 * Converts from Ptr16* datatype to wstring |
|
49 */ |
|
50 std::wstring Ptr16ToWstring(const Ptr16* aBuf); |
|
51 /** |
|
52 * Converts from Ptr16* datatype to string |
|
53 */ |
|
54 std::string Ptr16ToString(Ptr16* aBuf); |
|
55 |
|
56 |
|
57 class ParsePtrC |
|
58 { |
|
59 public: |
|
60 ParsePtrC(); |
|
61 ~ParsePtrC(); |
|
62 ParsePtrC(std::string aStr); |
|
63 ParsePtrC(const PtrC16* aName); |
|
64 |
|
65 PtrC16* FullName(); |
|
66 std::string StrName(); |
|
67 std::string Name(); |
|
68 std::string NameAndExt(); |
|
69 std::string FullPath(); |
|
70 std::string Path(); |
|
71 std::string Drive(); |
|
72 std::string FullNameWithoutDrive(); |
|
73 TInt NamePresent(); |
|
74 TInt PathPresent(); |
|
75 TInt ExtPresent(); |
|
76 TInt DrivePresent(); |
|
77 TInt IsWild(); |
|
78 TInt IsValidName(); |
|
79 void SetToNull(); |
|
80 |
|
81 private: |
|
82 PtrC16* iNameBuf; |
|
83 TInt iNamePresent; |
|
84 TInt iPathPresent; |
|
85 TInt iExtPresent; |
|
86 TInt iDrivePresent; |
|
87 std::string* Buf; |
|
88 }; |
|
89 |
|
90 #endif |