| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/iprofilestorage.h`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "iprofile.h"cxx . . $ `<file>/src/core/iprofile.h`/ |
| 7 | #include <filesystem> |
| 8 | #include <memory> |
| 9 | #include <vector> |
| 10 | |
| 11 | /// Stores profiles into a location. |
| 12 | class IProfileStoragecxx . . $ IProfileStorage# |
| 13 | { |
| 14 | public: |
| 15 | /// Initializes the profile storage. |
| 16 | /// @param defaultProfile default profile of the application |
| 17 | virtual void initcxx . . $ IProfileStorage#init(6c259bdacab5687).(IProfilecxx . . $ IProfile# const &defaultProfile) = 0; |
| 18 | |
| 19 | /// Reads the profiles on the storage. |
| 20 | /// @param baseProfile profile used as creation base |
| 21 | /// @return loaded profiles |
| 22 | virtual stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfilecxx . . $ IProfile#>> |
| 23 | profilescxx . . $ IProfileStorage#profiles(61ed034afd0cae0).(IProfilecxx . . $ IProfile# const &baseProfile) = 0; |
| 24 | |
| 25 | /// Loads a profile from the storage. |
| 26 | /// @param profile profile to be loaded |
| 27 | /// @return true on success |
| 28 | virtual bool loadcxx . . $ IProfileStorage#load(65662de94ba945c4).(IProfilecxx . . $ IProfile# &profile) = 0; |
| 29 | |
| 30 | /// Saves a profile into the storage. |
| 31 | /// @param profile profile to be saved |
| 32 | /// @return true on success |
| 33 | virtual bool savecxx . . $ IProfileStorage#save(65662de94ba945c4).(IProfilecxx . . $ IProfile# &profile) = 0; |
| 34 | |
| 35 | /// Loads a profile configuration from a file. |
| 36 | /// @param profile profile to be loaded |
| 37 | /// @param path path to the profile file |
| 38 | /// @return true on success |
| 39 | virtual bool loadFromcxx . . $ IProfileStorage#loadFrom(e6dc3a67757fd1b5).(IProfilecxx . . $ IProfile# &profile, |
| 40 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# const &path) const = 0; |
| 41 | |
| 42 | /// Exports a profile to a profile file. |
| 43 | /// @param profile profile to be exported |
| 44 | /// @param path path to the target profile file |
| 45 | /// @return true on success |
| 46 | virtual bool exportTocxx . . $ IProfileStorage#exportTo(58603e3286cb501).(IProfilecxx . . $ IProfile# const &profile, |
| 47 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# const &path) const = 0; |
| 48 | |
| 49 | /// Updates the info of a stored profile with new info. |
| 50 | /// @param profile profile of the stored profile to be updated |
| 51 | /// @param newInfo info to be updated |
| 52 | /// @return true on success |
| 53 | virtual bool updatecxx . . $ IProfileStorage#update(55d4602e6608d94e).(IProfilecxx . . $ IProfile# const &profile, IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# &newInfo) = 0; |
| 54 | |
| 55 | /// Removes a stored profile. |
| 56 | /// @param info info of the stored profile to be removed |
| 57 | virtual void removecxx . . $ IProfileStorage#remove(874cae2a8ac0280d).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# &info) = 0; |
| 58 | |
| 59 | virtual ~cxx . . $ IProfileStorage#`~IProfileStorage`(ced63f7c635d850d).IProfileStoragecxx . . $ IProfileStorage#() = default; |
| 60 | }; |