Add [[nodiscard]] specifiers as recommended by CLion.
This commit is contained in:
parent
41f5777379
commit
ceaa3ba6e4
9 changed files with 25 additions and 0 deletions
|
@ -45,7 +45,9 @@ class Writer {
|
||||||
|
|
||||||
auto position() -> std::int64_t;
|
auto position() -> std::int64_t;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto array() const -> Containers::ArrayView<const char>;
|
auto array() const -> Containers::ArrayView<const char>;
|
||||||
|
[[nodiscard]]
|
||||||
auto arrayPosition() const -> std::size_t;
|
auto arrayPosition() const -> std::size_t;
|
||||||
bool flushToFile();
|
bool flushToFile();
|
||||||
|
|
||||||
|
|
|
@ -28,30 +28,39 @@ class Configuration {
|
||||||
|
|
||||||
~Configuration();
|
~Configuration();
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool valid() const;
|
bool valid() const;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto lastError() const -> Containers::StringView;
|
auto lastError() const -> Containers::StringView;
|
||||||
|
|
||||||
void save();
|
void save();
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto swapInterval() const -> int;
|
auto swapInterval() const -> int;
|
||||||
void setSwapInterval(int interval);
|
void setSwapInterval(int interval);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto fpsCap() const -> float;
|
auto fpsCap() const -> float;
|
||||||
void setFpsCap(float cap);
|
void setFpsCap(float cap);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool cheatMode() const;
|
bool cheatMode() const;
|
||||||
void setCheatMode(bool enabled);
|
void setCheatMode(bool enabled);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool advancedMode() const;
|
bool advancedMode() const;
|
||||||
void setAdvancedMode(bool enabled);
|
void setAdvancedMode(bool enabled);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool checkUpdatesOnStartup() const;
|
bool checkUpdatesOnStartup() const;
|
||||||
void setCheckUpdatesOnStartup(bool mode);
|
void setCheckUpdatesOnStartup(bool mode);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool skipDisclaimer() const;
|
bool skipDisclaimer() const;
|
||||||
void setSkipDisclaimer(bool mode);
|
void setSkipDisclaimer(bool mode);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool isRunningInWine() const;
|
bool isRunningInWine() const;
|
||||||
void setRunningInWine(bool wine);
|
void setRunningInWine(bool wine);
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ class Mass {
|
||||||
|
|
||||||
auto state() -> State;
|
auto state() -> State;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool dirty() const;
|
bool dirty() const;
|
||||||
void setDirty(bool dirty = true);
|
void setDirty(bool dirty = true);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,9 @@ class File {
|
||||||
public:
|
public:
|
||||||
explicit File(Containers::String filepath);
|
explicit File(Containers::String filepath);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool valid() const;
|
bool valid() const;
|
||||||
|
[[nodiscard]]
|
||||||
auto lastError() const -> Containers::StringView;
|
auto lastError() const -> Containers::StringView;
|
||||||
|
|
||||||
bool reloadData();
|
bool reloadData();
|
||||||
|
|
|
@ -39,8 +39,10 @@ class BackupManager {
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto backups() const -> Containers::ArrayView<const Backup>;
|
auto backups() const -> Containers::ArrayView<const Backup>;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto vfs() const -> const Vfs::Directory<Backup>&;
|
auto vfs() const -> const Vfs::Directory<Backup>&;
|
||||||
|
|
||||||
bool create(const GameObjects::Profile& profile);
|
bool create(const GameObjects::Profile& profile);
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ProfileManager {
|
||||||
public:
|
public:
|
||||||
explicit ProfileManager();
|
explicit ProfileManager();
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto ready() const -> bool;
|
auto ready() const -> bool;
|
||||||
auto lastError() -> Containers::StringView;
|
auto lastError() -> Containers::StringView;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,10 @@ class StagedMassManager {
|
||||||
|
|
||||||
auto lastError() -> Containers::StringView;
|
auto lastError() -> Containers::StringView;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto stagedMasses() const -> Containers::ArrayView<const StagedMass>;
|
auto stagedMasses() const -> Containers::ArrayView<const StagedMass>;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto at(Containers::StringView filename) const -> const StagedMass&;
|
auto at(Containers::StringView filename) const -> const StagedMass&;
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Directory {
|
||||||
Directory(Directory<FileType>&& other) = default;
|
Directory(Directory<FileType>&& other) = default;
|
||||||
Directory& operator=(Directory<FileType>&& other) = default;
|
Directory& operator=(Directory<FileType>&& other) = default;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto name() const -> Containers::StringView {
|
auto name() const -> Containers::StringView {
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,12 +35,16 @@ class UpdateChecker {
|
||||||
|
|
||||||
auto check() -> Result;
|
auto check() -> Result;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto error() const -> Containers::StringView;
|
auto error() const -> Containers::StringView;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
bool updateAvailable() const;
|
bool updateAvailable() const;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto version() const -> const Version&;
|
auto version() const -> const Version&;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
auto downloadLink() const -> Containers::StringView;
|
auto downloadLink() const -> Containers::StringView;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue