MCPcopy Create free account
hub / github.com/csmith-project/csmith / parse_sequence

Method parse_sequence

src/SequenceLineParser.h:64–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64template <class Container> bool
65SequenceLineParser<Container>::parse_sequence(Container &q, const std::string &seq, const char sep_char)
66{
67 size_t pos = 0;
68 size_t start_pos = 0;
69
70 //while (pos < static_cast<int>(seq.size())) {
71 while(true) {
72 while (seq[pos] == ' ')
73 pos++;
74
75 start_pos = pos;
76 pos = seq.find_first_of(sep_char, pos);
77 std::string s = seq.substr(start_pos, (pos - start_pos));
78 int i = SequenceLineParser::str2int(s);
79 if (i < 0)
80 return false;
81 q.push_back(i);
82 if (pos == string::npos)
83 break;
84 pos++;
85 }
86 return true;
87}
88
89template <class Container> int
90SequenceLineParser<Container>::str2int(const std::string &s)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected