~aleteoryx/muditaos

ref: 4bf9cb7ace7a74a7dadf011338b18b59fea8fbe4 muditaos/module-services/service-desktop/endpoints/backup/BackupRestore.hpp -rw-r--r-- 860 bytes
4bf9cb7a — Tomasz Sobkowiak [EGD-6259] Turn off usb security 4 years ago
                                                                                
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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <Service/Service.hpp>
#include <filesystem>

namespace sys
{
    class Service;
} // namespace sys

class BackupRestore
{
  public:
    BackupRestore(){};
    ~BackupRestore(){};
    static bool BackupUserFiles(sys::Service *ownerService, std::filesystem::path &path);
    static void RestoreUserFiles(sys::Service *ownerService);

  private:
    static bool RemoveBackupDir(std::filesystem::path &path);
    static bool CreateBackupDir(std::filesystem::path &path);
    static bool PackUserFiles(std::filesystem::path &path);
    static bool UnpackBackupFile();
    static bool ReplaceUserFiles();
    static bool WriteBackupInfo(sys::Service *ownerService, const std::filesystem::path &path);
};