1/***************************************************************************
2 kfilereplacelib.h - File library, derived from filelib.h
3 -------------------
4 begin : lun mai 3 20:19:52 CEST 1999
5
6 copyright : (C) 1999 by François Dupoux
7 (C) 2003 Andras Mantia <amantia@kde.org>
8 (C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
9 email : dupoux@dupoux.com
10 ***************************************************************************/
11
12/***************************************************************************
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 ***************************************************************************/
20
21#ifndef KFILEREPLACELIB_H
22#define KFILEREPLACELIB_H
23
24// KDE
25#include <klocale.h>
26
27// local
28#include "configurationclasses.h"
29
30class KFileReplaceLib
31{
32 public:
33
34 /**
35 Format a path, from a path and a filename, or another sub-path (avoid double '/' risks)
36 Parameters::.....* basePath: fist path (can be "/" if root, or "/usr/bin/" or "/usr/bin" for example)
37 .................* filename: second path (can be "/doc/html/", or "doc/html/" or "doc/html/index.html" for example)
38 Return values:...* Full valid path (without double "/")
39 */
40 static QString formatFullPath(const QString& basePath, const QString& fileName);
41
42 /**
43 Add an extension to a filename, or a filepath
44 Parameters::.....* filename: filename or filepath (it can have already the extension)
45 .................* extension: extension to add without "." (ex: "html", "kfr")
46 Return values:...* Filename / Filepath with the extension
47 */
48 static QString addExtension(const QString& fileName, const QString& extension);
49
50 static QString formatFileSize(double size);
51
52 /**
53 converts the old kfr format file in the new xml-based format.
54 */
55 static void convertOldToNewKFRFormat(const QString& fileName, K3ListView* stringView);
56 /**
57 Verifies that files, which we are scanning, respect some
58 conditions
59 */
60 static bool isAnAccessibleFile(const QString& filePath, const QString& fileName, RCOptions* info);
61
62 static void setIconForFileEntry(Q3ListViewItem* item, const QString &path);
63};
64#endif // KFILEREPLACEFILELIB_H
65