SPH
Platform.h
Go to the documentation of this file.
1 #pragma once
2 
7 
10 #include <stdio.h>
11 
13 
14 class Path;
15 
18 
20 Outcome sendMail(const std::string& to,
21  const std::string& from,
22  const std::string& subject,
23  const std::string& message);
24 
28 Outcome showNotification(const std::string& title, const std::string& message);
29 
36 Outcome sendPushNotification(const std::string& key, const std::string& title, const std::string& message);
37 
43 Expected<std::string> getGitCommit(const Path& pathToGitRoot, const Size prev = 0);
44 
46 
48 bool isDebuggerPresent();
49 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Wrapper of type containing either a value or an error message.
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
#define NAMESPACE_SPH_END
Definition: Object.h:12
Return value of function that may fail, containing either SUCCEES (true) or error message.
Optional< Float > getCpuUsage()
Definition: Platform.cpp:144
Expected< Path > getExecutablePath()
Returns the absolute path to the currently running executable.
Definition: Platform.cpp:15
Outcome sendMail(const std::string &to, const std::string &from, const std::string &subject, const std::string &message)
Sends a mail with given message.
Definition: Platform.cpp:26
Outcome sendPushNotification(const std::string &key, const std::string &title, const std::string &message)
Sends a push notification to an Android device, using SimplePush API.
Definition: Platform.cpp:53
Expected< std::string > getGitCommit(const Path &pathToGitRoot, const Size prev=0)
Returns git commit hash of the current or older commit as string.
Definition: Platform.cpp:63
Outcome showNotification(const std::string &title, const std::string &message)
Shows a notification using 'notify-send' command.
Definition: Platform.cpp:44
bool isDebuggerPresent()
Returns true if the program is running with attached debugger.
Definition: Platform.cpp:149
Wrapper of type that either contains a value of given type, or an error message.
Definition: Expected.h:25
Object representing a path on a filesystem.
Definition: Path.h:17