-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathRiaFilePathTools.h
More file actions
52 lines (46 loc) · 2.41 KB
/
Copy pathRiaFilePathTools.h
File metadata and controls
52 lines (46 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QByteArray>
#include <QString>
#include <QStringList>
#include <map>
#include <string>
//==================================================================================================
//
//==================================================================================================
namespace RiaFilePathTools
{
const QChar separator();
QString toInternalSeparator( const QString& path );
QString& appendSeparatorIfNo( QString& path );
QString relativePath( const QString& rootDir, const QString& dir );
bool equalPaths( const QString& path1, const QString& path2 );
QString canonicalPath( const QString& path );
std::pair<QString, QString> toFolderAndFileName( const QString& absFileName );
QString removeDuplicatePathSeparators( const QString& path );
QString rootSearchPathFromSearchFilter( const QString& searchFilter );
QString commonRootOfFileNames( const QStringList& filePaths );
std::string makeSuitableAsFileName( const std::string candidateName );
std::string normalizePath( std::string path );
QStringList splitPathIntoComponents( const QString& path, bool splitExtensionIntoSeparateEntry = false );
std::map<QString, QStringList> keyPathComponentsForEachFilePath( const QStringList& filePaths );
bool isFirstOlderThanSecond( const std::string& firstFileName, const std::string& secondFileName, int timeThresholdInSeconds );
}; // namespace RiaFilePathTools