chore(falco): apply code formatting

Signed-off-by: Poiana <poiana.bot@gmail.com>
This commit is contained in:
Poiana
2024-09-30 10:53:51 +02:00
committed by poiana
parent 11bac9dbd2
commit 50b98b30e5
169 changed files with 8681 additions and 9539 deletions

View File

@@ -23,53 +23,55 @@ limitations under the License.
#include <libsinsp/version.h>
#include "falco_engine_version.h"
namespace rule_loader
{
namespace rule_loader {
/*!
\brief Reads the contents of a ruleset
*/
class reader
{
class reader {
public:
reader() = default;
virtual ~reader() = default;
reader(reader&&) = default;
reader& operator = (reader&&) = default;
reader() = default;
virtual ~reader() = default;
reader(reader&&) = default;
reader& operator=(reader&&) = default;
reader(const reader&) = default;
reader& operator = (const reader&) = default;
reader& operator=(const reader&) = default;
/*!
\brief Reads the contents of a ruleset and uses a collector to store
thew new definitions
/*!
\brief Reads the contents of a ruleset and uses a collector to store
thew new definitions
*/
virtual bool read(configuration& cfg, collector& loader, const nlohmann::json& schema={});
/*!
\brief Engine version used to be represented as a simple progressive
virtual bool read(configuration& cfg, collector& loader, const nlohmann::json& schema = {});
/*!
\brief Engine version used to be represented as a simple progressive
number. With the new semver schema, the number now represents
the semver minor number. This function converts the legacy version
the semver minor number. This function converts the legacy version
number to the new semver schema.
*/
static inline sinsp_version get_implicit_engine_version(uint32_t minor)
{
return sinsp_version(std::to_string(FALCO_ENGINE_VERSION_MAJOR) + "."
+ std::to_string(minor) + "."
+ std::to_string(FALCO_ENGINE_VERSION_PATCH));
*/
static inline sinsp_version get_implicit_engine_version(uint32_t minor) {
return sinsp_version(std::to_string(FALCO_ENGINE_VERSION_MAJOR) + "." +
std::to_string(minor) + "." +
std::to_string(FALCO_ENGINE_VERSION_PATCH));
}
template <typename T>
static void decode_val(const YAML::Node& item, const char *key, T& out, const rule_loader::context& ctx);
template<typename T>
static void decode_val(const YAML::Node& item,
const char* key,
T& out,
const rule_loader::context& ctx);
template <typename T>
static void decode_optional_val(const YAML::Node& item, const char *key, T& out, const rule_loader::context& ctx);
template<typename T>
static void decode_optional_val(const YAML::Node& item,
const char* key,
T& out,
const rule_loader::context& ctx);
protected:
virtual void read_item(rule_loader::configuration& cfg,
rule_loader::collector& collector,
const YAML::Node& item,
const rule_loader::context& parent);
rule_loader::collector& collector,
const YAML::Node& item,
const rule_loader::context& parent);
};
}; // namespace rule_loader
}; // namespace rule_loader