diff --git a/auditd-record.cpp b/auditd-record.cpp index 4ca6ef3..834a354 100644 --- a/auditd-record.cpp +++ b/auditd-record.cpp @@ -278,9 +278,9 @@ void CommonStringRecordField::setStringValue(const boost::optional m_value = value; } -std::shared_ptr StringRecordField::createRecord(const std::string &name) +std::shared_ptr StringRecordField::createRecord(const std::string &name) { - std::shared_ptr result; + std::shared_ptr result; result.reset(new StringRecordField(name)); return result; } @@ -307,9 +307,9 @@ AbstractRecordField::Type StringRecordField::getType() const return AbstractRecordField::Type::String; } -std::shared_ptr InterpretedStringRecordField::createRecord(const std::string &name) +std::shared_ptr InterpretedStringRecordField::createRecord(const std::string &name) { - std::shared_ptr result; + std::shared_ptr result; result.reset(new InterpretedStringRecordField(name)); return result; } @@ -336,9 +336,9 @@ AbstractRecordField::Type InterpretedStringRecordField::getType() const return AbstractRecordField::Type::InterpretedString; } -std::shared_ptr IntegerRecordField::createRecord(const std::string &name) +std::shared_ptr IntegerRecordField::createRecord(const std::string &name) { - std::shared_ptr result; + std::shared_ptr result; result.reset(new IntegerRecordField(name)); return result; } @@ -427,9 +427,9 @@ void IntegerRecordField::setIntValue(const boost::optional &value) m_int_value = value; } -std::shared_ptr InterpretedStringArrayRecordField::createRecord(const std::string &name) +std::shared_ptr InterpretedStringArrayRecordField::createRecord(const std::string &name) { - std::shared_ptr result; + std::shared_ptr result; result.reset(new InterpretedStringArrayRecordField(name)); return result; } @@ -657,7 +657,7 @@ AuditRecord AuditRecord::fromPtree(const boost::property_tree::ptree &data) { case AbstractRecordField::Type::Int: { - auto record_field = std::dynamic_pointer_cast(IntegerRecordField::createRecord(iter->first)); + auto record_field = IntegerRecordField::createRecord(iter->first); if (record_field) { auto int_value = iter->second.get_child_optional("value_int"); @@ -679,7 +679,7 @@ AuditRecord AuditRecord::fromPtree(const boost::property_tree::ptree &data) case AbstractRecordField::Type::String: { - auto record_field = std::dynamic_pointer_cast(StringRecordField::createRecord(iter->first)); + auto record_field = StringRecordField::createRecord(iter->first); if (record_field) { auto str_value = iter->second.get_child_optional("value_str"); @@ -695,7 +695,7 @@ AuditRecord AuditRecord::fromPtree(const boost::property_tree::ptree &data) case AbstractRecordField::Type::InterpretedString: { - auto record_field = std::dynamic_pointer_cast(InterpretedStringRecordField::createRecord(iter->first)); + auto record_field = InterpretedStringRecordField::createRecord(iter->first); if (record_field) { auto str_value = iter->second.get_child_optional("value_str"); @@ -711,7 +711,7 @@ AuditRecord AuditRecord::fromPtree(const boost::property_tree::ptree &data) case AbstractRecordField::Type::InterpretedStringArray: { - auto record_field = std::dynamic_pointer_cast(InterpretedStringArrayRecordField::createRecord(iter->first)); + auto record_field = InterpretedStringArrayRecordField::createRecord(iter->first); if (record_field) { std::list names, values; diff --git a/auditd-record.hpp b/auditd-record.hpp index d240a22..5bee977 100644 --- a/auditd-record.hpp +++ b/auditd-record.hpp @@ -118,7 +118,7 @@ protected: class StringRecordField: public CommonStringRecordField { public: - static std::shared_ptr createRecord(const std::string &name); + static std::shared_ptr createRecord(const std::string &name); virtual void addOrUpdateValue(auparse_state_t *record) override; virtual Type getType() const override; @@ -130,7 +130,7 @@ protected: class InterpretedStringRecordField: public CommonStringRecordField { public: - static std::shared_ptr createRecord(const std::string &name); + static std::shared_ptr createRecord(const std::string &name); virtual void addOrUpdateValue(auparse_state_t *record) override; virtual Type getType() const override; @@ -142,7 +142,7 @@ protected: class IntegerRecordField: public InterpretedStringRecordField { public: - static std::shared_ptr createRecord(const std::string &name); + static std::shared_ptr createRecord(const std::string &name); virtual void addOrUpdateValue(auparse_state_t *record) override; virtual std::vector generateColumnsAndNames() const override; @@ -161,7 +161,7 @@ protected: class InterpretedStringArrayRecordField: public AbstractRecordField { public: - static std::shared_ptr createRecord(const std::string &name); + static std::shared_ptr createRecord(const std::string &name); virtual void addOrUpdateValue(auparse_state_t *record) override; virtual std::vector generateColumnsAndNames() const override;