1 /*
2  * Copyright (c) 1999, 2021 Tanuki Software, Ltd.
3  * http://www.tanukisoftware.com
4  * All rights reserved.
5  *
6  * This software is the proprietary information of Tanuki Software.
7  * You shall use it only in accordance with the terms of the
8  * license agreement you entered into with Tanuki Software.
9  * http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
10  */
11 
12 /**
13  * Author:
14  *   Tanuki Software Development Team <support@tanukisoftware.com>
15  */
16 
17 #ifndef _LOGGER_FILE_H
18 #define _LOGGER_FILE_H
19 
20 #ifdef WIN32
21  #include <tchar.h>
22 #endif
23 #include "wrapper_i18n.h"
24 
25 /*#define LOGGER_FILE_DEBUG*/
26 
27 #define LOGGER_FILE_SORT_MODE_TIMES 100
28 #define LOGGER_FILE_SORT_MODE_NAMES_ASC 101
29 #define LOGGER_FILE_SORT_MODE_NAMES_DEC 102
30 #define LOGGER_FILE_SORT_MODE_NAMES_SMART 103
31 
32 /**
33  * Returns a valid sort mode given a name: "TIMES", "NAMES_ASC", "NAMES_DEC", "NAMES_SMART".
34  *  In the event of an invalid value, TIMES will be returned.
35  */
36 extern int loggerFileGetSortMode(const TCHAR *modeName);
37 
38 /**
39  * Returns a NULL terminated list of file names within the specified pattern.
40  *  The files will be sorted new to old for TIMES.  Then incremental ordering
41  *  for NAMES.  The numeric components of the names will be treated as
42  *  numbers and sorted accordingly.
43  */
44 extern TCHAR** loggerFileGetFiles(const TCHAR* pattern, int sortMode);
45 
46 /**
47  * Frees the array of file names returned by wrapperFileGetFiles()
48  */
49 extern void loggerFileFreeFiles(TCHAR** files);
50 
51 extern TCHAR *combinePath(const TCHAR *path1, const TCHAR *path2);
52 
53 extern TCHAR *getRealPath(const TCHAR *path, const TCHAR *pathDesc, int errorLevel, int useQueue);
54 
55 TCHAR* getAbsolutePathOfFile(const TCHAR* path, const TCHAR *pathDesc, int errorLevel, int useQueue);
56 #endif
57