exercism-solutions/cpp/nucleotide-count/nucleotide_count.h

27 lines
390 B
C++

#pragma once
#define EXERCISM_RUN_ALL_TESTS
#include <map>
#include <string>
namespace dna {
typedef std::map<char, int> NucleotideCounts;
class counter
{
NucleotideCounts nucleotide_counts_;
bool is_valid_nucleotide(char c) const;
public:
counter(const std::string &sequence);
const NucleotideCounts &nucleotide_counts() const;
int count(char c) const;
};
}