|
1 /* |
|
2 * Copyright (c) 2005 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: XcapCacheServerMain.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "XcapCacheServer.h" |
|
21 |
|
22 // ---------------------------------------------------------- |
|
23 // DeleteLogFiles |
|
24 // |
|
25 // ---------------------------------------------------------- |
|
26 // |
|
27 TInt DeleteLogFileL() |
|
28 { |
|
29 RFs session; |
|
30 TInt error = session.Connect(); |
|
31 if( error == KErrNone ) |
|
32 { |
|
33 CFileMan* manager = CFileMan::NewL( session ); |
|
34 error = manager->Delete( _L( "C:\\logs\\XDM\\CacheServer.txt" ) ); |
|
35 session.Close(); |
|
36 delete manager; |
|
37 manager = NULL; |
|
38 } |
|
39 return error; |
|
40 } |
|
41 |
|
42 // ---------------------------------------------------------- |
|
43 // E32Main |
|
44 // |
|
45 // ---------------------------------------------------------- |
|
46 // |
|
47 GLDEF_C TInt E32Main() |
|
48 { |
|
49 __UHEAP_MARK; |
|
50 TInt error = KErrNoMemory; |
|
51 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
52 #ifdef _DEBUG |
|
53 TRAPD( logErr, DeleteLogFileL() ); |
|
54 TBuf8<KMaxFileName> exe; |
|
55 TFileName name( RProcess().FileName() ); |
|
56 exe.Copy( name ); |
|
57 CXcapCacheServer::WriteToLog( _L8( "*** E32Main(): Exe loaded from %S - Log deletion: %d"), |
|
58 &exe, logErr ); |
|
59 #endif |
|
60 if( cleanup ) |
|
61 { |
|
62 TRAP( error, CXcapCacheServer::StartThreadL() ); |
|
63 delete cleanup; |
|
64 } |
|
65 __UHEAP_MARKEND; |
|
66 #ifdef _DEBUG |
|
67 CXcapCacheServer::WriteToLog( _L8( "*** E32Main() completes: %d" ), error ); |
|
68 #endif |
|
69 return error; |
|
70 } |
|
71 |
|
72 // End of File |
|
73 |