Antares Simulator
Power System Simulator
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages Concepts
cleaner.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#ifndef __ANTARES_LIBS_STUDY_CLEANER_H__
22#define __ANTARES_LIBS_STUDY_CLEANER_H__
23
24#include <yuni/yuni.h>
25#include <yuni/core/bind.h>
26#include <yuni/core/string.h>
27
28#include <antares/paths/list.h>
29
30#include "version.h"
31
32namespace Antares::Data
33{
35{
36public:
38
39
46 explicit StudyCleaningInfos(const AnyString& path);
52
56 bool analyze();
57
61 void performCleanup();
62
66 uint64_t totalSize() const;
67
71 void setCustomExcludeList(const Yuni::String& c);
72
73public:
75 Yuni::String folder;
76
84 Yuni::String customExclude;
85
87 /* This list mainly ensures that a list of folders will not deleted enven if empty */
89
95 std::function<bool(uint)> onProgress;
96
97}; // class StudyCleaningInfos
98
99} // namespace Antares::Data
100
101#endif /* __ANTARES_LIBS_STUDY_CLEANER_H__ */
Definition cleaner.h:35
Yuni::String customExclude
Definition cleaner.h:84
Yuni::String folder
Definition cleaner.h:75
void performCleanup()
Perform a complete cleanup.
Definition cleaner.cpp:104
::PathList intruders
Definition cleaner.h:80
::PathList postExclude
Definition cleaner.h:88
bool analyze()
Determine the complete list of all files/folder considered as intruders.
Definition cleaner.cpp:49
std::function< bool(uint)> onProgress
Event triggered when entering into a new folder.
Definition cleaner.h:95
void setCustomExcludeList(const Yuni::String &c)
Set an additional list of excluded files or directories.
Definition cleaner.cpp:120
uint64_t totalSize() const
Get the total size occupied by the intruders.
Definition cleaner.cpp:115
::PathList exclude
Definition cleaner.h:82
StudyVersion version
Definition cleaner.h:78
StudyCleaningInfos()
Default Constructor.
Definition cleaner.cpp:38
Version of a study.
Definition version.h:36
Path list structure.
Definition list.h:48