45template<
typename Label_>
46std::vector<Label_> load_labels(byteme::Reader& reader,
bool parallel) {
47 bool non_empty =
false;
49 std::vector<Label_> labels;
51 std::unique_ptr<byteme::PerByteInterface<char> > pbptr;
53 pbptr.reset(
new byteme::PerByteParallel<char, byteme::Reader*>(&reader));
55 pbptr.reset(
new byteme::PerByteSerial<char, byteme::Reader*>(&reader));
59 bool okay = pb.valid();
66 throw std::runtime_error(
"label index must be an integer");
68 labels.push_back(current);
71 }
else if (std::isdigit(x)) {
76 throw std::runtime_error(
"label index must be an integer");
81 labels.push_back(current);
105template<
typename Label_ = singlepp::DefaultLabel>
107 byteme::RawFileReaderOptions read_opt;
109 byteme::RawFileReader reader(path, read_opt);
110 return internal::load_labels<Label_>(reader, options.
parallel);
123template<
typename Label_ = singlepp::DefaultLabel>
125 byteme::GzipFileReaderOptions read_opt;
127 byteme::GzipFileReader reader(path, read_opt);
128 return internal::load_labels<Label_>(reader, options.
parallel);
142template<
typename Label_ = singlepp::DefaultLabel>
144 byteme::ZlibBufferReaderOptions read_opt;
147 byteme::ZlibBufferReader reader(buffer, len, read_opt);
148 return internal::load_labels<Label_>(reader, options.
parallel);