| 190 | } |
| 191 | |
| 192 | std::vector<Bytes> Bytes::split(uint8_t separator) const |
| 193 | { |
| 194 | std::vector<Bytes> vector; |
| 195 | |
| 196 | int lastEnd = 0; |
| 197 | for (int i = 0; i < size(); i++) |
| 198 | { |
| 199 | if ((*this)[i] == separator) |
| 200 | { |
| 201 | vector.push_back(this->slice(lastEnd, i - lastEnd)); |
| 202 | lastEnd = i + 1; |
| 203 | } |
| 204 | } |
| 205 | vector.push_back(this->slice(lastEnd)); |
| 206 | |
| 207 | return vector; |
| 208 | } |
| 209 | |
| 210 | std::vector<bool> Bytes::toBits() const |
| 211 | { |