LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
FileUtils.h
Go to the documentation of this file.
1// Copyright 2015 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 * @file FileUtils.h
8 * @author Gael de Chalendar
9 * @date Tue Jul 7 2015
10 * copyright Copyright (C) 2015 by CEA LIST
11 ***********************************************************************/
12
13#ifndef LIMA_COMMON_MISC_FILEUTILS_H
14#define LIMA_COMMON_MISC_FILEUTILS_H
15
16#include "common/LimaCommon.h"
17
18#include <QtCore/QFile>
19
20#include <iostream>
21
22#ifdef WIN32
23#define LIMA_PATH_SEPARATOR ';'
24#else
25#define LIMA_PATH_SEPARATOR ':'
26#endif
27
28#define FILESREPORTLOGINIT LOGINIT("FilesReporting")
29
30namespace Lima {
31namespace Common {
32namespace Misc {
33
44LIMA_COMMONTOOLS_EXPORT uint64_t countLines(std::istream& file);
45
56LIMA_COMMONTOOLS_EXPORT uint64_t countLines(QFile& file);
57
58
80LIMA_COMMONTOOLS_EXPORT QStringList buildConfigurationDirectoriesList(const QStringList& projects = QStringList(),
81 const QStringList& paths = QStringList() );
82
99LIMA_COMMONTOOLS_EXPORT QStringList buildResourcesDirectoriesList(const QStringList& projects,
100 const QStringList& paths = QStringList());
101
110LIMA_COMMONTOOLS_EXPORT QString findFileInPaths(const QString& paths, const QString& fileName,
111 const QChar& separator = QLatin1Char(LIMA_PATH_SEPARATOR));
112
113} // end namespace
114} // end namespace
115} // end namespace
116
117#endif
#define LIMA_PATH_SEPARATOR
Definition FileUtils.h:25
#define LIMA_COMMONTOOLS_EXPORT
Definition LimaCommon.h:134
QStringList buildResourcesDirectoriesList(const QStringList &projects, const QStringList &paths)
Build a list of resources directories from a list of project names and a list of paths.
uint64_t countLines(std::istream &file)
Count the number of lines in the given file from the current position.
Definition FileUtils.cpp:23
QString findFileInPaths(const QString &paths, const QString &fileName, const QChar &separator)
Find the given file in the given paths.
QStringList buildConfigurationDirectoriesList(const QStringList &projects, const QStringList &paths)
Build a list of configuration directories from a list of project names and a list of paths.
NAUTITIA.