MCPcopy Create free account
hub / github.com/DFIR-ORC/dfir-orc / AddSampleName

Method AddSampleName

src/OrcLib/Configuration/ConfigFile.cpp:684–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682}
683
684HRESULT ConfigFile::AddSampleName(ConfigItem& item, const std::wstring& sampleName)
685{
686 ConfigItem sample;
687 sample = item;
688 sample.Status = ConfigItem::PRESENT;
689 sample.Type = ConfigItem::NODE;
690 item.NodeList.push_back(std::move(sample));
691
692 ConfigItem& sampleitem = item.NodeList.back();
693
694 ConfigItem ntfs_find;
695 ntfs_find = sampleitem.SubItems[CONFIG_SAMPLE_FILEFIND];
696 ntfs_find.Type = ConfigItem::NODE;
697 ntfs_find.Status = ConfigItem::PRESENT;
698
699 ntfs_find.SubItems[CONFIG_FILEFIND_NAME].strData = sampleName;
700 ntfs_find.SubItems[CONFIG_FILEFIND_NAME].Status = ConfigItem::PRESENT;
701
702 sampleitem.SubItems[CONFIG_SAMPLE_FILEFIND].NodeList.push_back(ntfs_find);
703 sampleitem.SubItems[CONFIG_SAMPLE_FILEFIND].Status = ConfigItem::PRESENT;
704
705 item.Status = ConfigItem::PRESENT;
706 return S_OK;
707}
708
709HRESULT ConfigFile::SetLocations(ConfigItem& item, const std::vector<std::shared_ptr<Location>>& locs)
710{

Callers 1

WriteGetThisConfigMethod · 0.80

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected