mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-11-30 09:08:53 +00:00
docs(doxygen): enforce warn if undocumented (#5337)
This commit is contained in:
1 parent
be7c1bcdfb
commit
a991a9622c
141 files changed
+11804
-1524
No files matched your search
+49
-1
@@ -43,10 +43,16 @@ namespace proc {
|
||||
using namespace std::literals;
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
proc_t proc;
|
||||
proc_t proc; ///< Global process registry used to track and terminate child processes.
|
||||
|
||||
/**
|
||||
* @brief RAII helper that runs shutdown cleanup when destroyed.
|
||||
*/
|
||||
class deinit_t: public platf::deinit_t {
|
||||
public:
|
||||
/**
|
||||
* @brief Destroy the process subsystem deinitializer.
|
||||
*/
|
||||
~deinit_t() {
|
||||
proc.terminate();
|
||||
}
|
||||
@@ -94,6 +100,13 @@ namespace proc {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resolve the working directory for a configured command.
|
||||
*
|
||||
* @param cmd Command line to execute or inspect.
|
||||
* @param env Environment variables for the child process.
|
||||
* @return Directory used to launch the command, falling back to PATH lookup when needed.
|
||||
*/
|
||||
boost::filesystem::path find_working_directory(const std::string &cmd, boost::process::v1::environment &env) {
|
||||
// Parse the raw command string into parts to get the actual command portion
|
||||
std::vector<std::string> parts;
|
||||
@@ -388,6 +401,13 @@ namespace proc {
|
||||
assert(!_process.running());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Find the closing parenthesis for an environment-variable expression.
|
||||
*
|
||||
* @param begin Iterator positioned at the opening parenthesis.
|
||||
* @param end End iterator for the expression being scanned.
|
||||
* @return Iterator for the matching closing parenthesis, or end when unmatched.
|
||||
*/
|
||||
std::string_view::iterator find_match(std::string_view::iterator begin, std::string_view::iterator end) {
|
||||
int stack = 0;
|
||||
|
||||
@@ -409,6 +429,13 @@ namespace proc {
|
||||
return begin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse env val.
|
||||
*
|
||||
* @param env Environment variables for the child process.
|
||||
* @param val_raw Raw value that may contain $(NAME) substitutions.
|
||||
* @return Value with recognized environment-variable substitutions expanded.
|
||||
*/
|
||||
std::string parse_env_val(boost::process::v1::native_environment &env, const std::string_view &val_raw) {
|
||||
auto pos = std::begin(val_raw);
|
||||
auto dollar = std::find(pos, std::end(val_raw), '$');
|
||||
@@ -498,6 +525,9 @@ namespace proc {
|
||||
return header == PNG_SIGNATURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Validate app image path.
|
||||
*/
|
||||
std::string validate_app_image_path(std::string app_image_path) {
|
||||
if (app_image_path.empty()) {
|
||||
return DEFAULT_APP_IMAGE_PATH;
|
||||
@@ -545,6 +575,12 @@ namespace proc {
|
||||
return app_image_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the SHA-256 digest for a file.
|
||||
*
|
||||
* @param filename File path whose contents should be hashed.
|
||||
* @return Lowercase hexadecimal SHA-256 digest, or std::nullopt on read/hash failure.
|
||||
*/
|
||||
std::optional<std::string> calculate_sha256(const std::string &filename) {
|
||||
crypto::md_ctx_t ctx {EVP_MD_CTX_create()};
|
||||
if (!ctx) {
|
||||
@@ -580,6 +616,12 @@ namespace proc {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the CRC-32 checksum for a string.
|
||||
*
|
||||
* @param input Bytes to include in the checksum.
|
||||
* @return CRC-32 value for the input bytes.
|
||||
*/
|
||||
uint32_t calculate_crc32(const std::string &input) {
|
||||
boost::crc_32_type result;
|
||||
result.process_bytes(input.data(), input.length());
|
||||
@@ -617,6 +659,9 @@ namespace proc {
|
||||
return std::make_tuple(id_no_index, id_with_index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse serialized text into the corresponding runtime representation.
|
||||
*/
|
||||
std::optional<proc::proc_t> parse(const std::string &file_name) {
|
||||
pt::ptree tree;
|
||||
|
||||
@@ -748,6 +793,9 @@ namespace proc {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Refresh cached platform state from the operating system.
|
||||
*/
|
||||
void refresh(const std::string &file_name) {
|
||||
auto proc_opt = proc::parse(file_name);
|
||||
|
||||
|
||||
Reference in new issue
Block a user