0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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 |
* Switches
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef __FILE_UTILITIES_H__
|
|
22 |
#define __FILE_UTILITIES_H__
|
|
23 |
|
|
24 |
|
|
25 |
/******************************************************************************************************
|
|
26 |
*
|
|
27 |
* System Includes
|
|
28 |
*
|
|
29 |
*****************************************************************************************************/
|
|
30 |
#include <string>
|
|
31 |
using namespace std;
|
|
32 |
|
|
33 |
|
|
34 |
/******************************************************************************************************
|
|
35 |
*
|
|
36 |
* Types
|
|
37 |
*
|
|
38 |
*****************************************************************************************************/
|
|
39 |
typedef enum {
|
|
40 |
FUE_NONE,
|
|
41 |
FUE_READ_ERROR,
|
|
42 |
FUE_WRITE_ERROR,
|
|
43 |
FUE_OPEN_ERROR,
|
|
44 |
FUE_OPEN_TEMP_ERROR,
|
|
45 |
FUE_OPEN_SOURCE_ERROR,
|
|
46 |
FUE_RENAME_ERROR,
|
|
47 |
FUE_END_OF_FILE,
|
|
48 |
} TFUError;
|
|
49 |
|
|
50 |
|
|
51 |
/******************************************************************************************************
|
|
52 |
*
|
|
53 |
* Prototypes
|
|
54 |
*
|
|
55 |
*****************************************************************************************************/
|
|
56 |
FILE *OpenTempfile( char *aFilenamePrefix, char *aFilename, int aLen, char *aMode, int *aSystemError );
|
|
57 |
TFUError CopyFileByPtr( FILE *aSource, FILE *aDest, int *aSystemError );
|
|
58 |
TFUError CopyFileByName( char *aSource, char *aDest, int *aSystemError );
|
|
59 |
TFUError GetLine( char *aFilename, int aLineNumber, char *aBuffer, int aBufferSize, int *aSystemError );
|
|
60 |
TFUError InsertLine( char *aFilename, int aLineNumber, char *aLine, int aLineSize, int aReplaceFlag, int *aSystemError );
|
|
61 |
TFUError FindMatchingLines( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError );
|
|
62 |
TFUError FindMatchingLinesByRawPrefix( char *aFilename, char *aToken, int *aLineList, int *aListSize, int *aSystemError );
|
|
63 |
TFUError GetFileLineCount( char *aFilename, int *aLineCount, int *aSystemError );
|
|
64 |
|
|
65 |
#endif
|