From 3cf61da3668073e2e5fb7118f91bd352a36ce24e Mon Sep 17 00:00:00 2001 From: Cristina Yenyxe Gonzalez Garcia Date: Mon, 8 Jun 2015 16:57:36 +0100 Subject: [PATCH] Usage of boost::split completely replaced by strpbrk wrapper --- inc/util/string_utils.hpp | 1 + inc/vcf/record.hpp | 1 - inc/vcf/validator.hpp | 4 ++-- src/vcf/store_parse_policy.cpp | 3 ++- src/vcf/validate_optional_policy.cpp | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/util/string_utils.hpp b/inc/util/string_utils.hpp index 47bc383c5..a89afef02 100644 --- a/inc/util/string_utils.hpp +++ b/inc/util/string_utils.hpp @@ -8,6 +8,7 @@ #ifndef STRING_UTILS_HPP #define STRING_UTILS_HPP +#include #include #include diff --git a/inc/vcf/record.hpp b/inc/vcf/record.hpp index b8e5ff2ab..230ada148 100644 --- a/inc/vcf/record.hpp +++ b/inc/vcf/record.hpp @@ -10,7 +10,6 @@ #include -#include #include #include #include diff --git a/inc/vcf/validator.hpp b/inc/vcf/validator.hpp index 26eb9af2f..8a107b80b 100644 --- a/inc/vcf/validator.hpp +++ b/inc/vcf/validator.hpp @@ -10,9 +10,9 @@ #include #include -#include - #include "file_structure.hpp" +#include "util/string_utils.hpp" + namespace opencb { diff --git a/src/vcf/store_parse_policy.cpp b/src/vcf/store_parse_policy.cpp index 3cb083cb4..624774aab 100644 --- a/src/vcf/store_parse_policy.cpp +++ b/src/vcf/store_parse_policy.cpp @@ -1,4 +1,5 @@ #include "vcf/validator.hpp" +#include "util/string_utils.hpp" namespace opencb { @@ -147,7 +148,7 @@ namespace opencb std::map info; for (auto & field : m_line_tokens["INFO"]) { std::vector subfields; - boost::split(subfields, field, boost::is_any_of("=")); + util::string_split(field, "=", subfields); if (subfields.size() > 1) { info.emplace(subfields[0], subfields[1]); } else { diff --git a/src/vcf/validate_optional_policy.cpp b/src/vcf/validate_optional_policy.cpp index 390225631..081ffff29 100644 --- a/src/vcf/validate_optional_policy.cpp +++ b/src/vcf/validate_optional_policy.cpp @@ -62,9 +62,9 @@ namespace opencb size_t i = 1; for (auto & sample : record.samples) { std::vector subfields; - boost::split(subfields, sample, boost::is_any_of(":")); + util::string_split(sample, ":", subfields); std::vector alleles; - boost::split(alleles, subfields[0], boost::is_any_of("|,/")); + util::string_split(subfields[0], "|/", alleles); if (ploidy > 0) { if (alleles.size() != ploidy) {