45template<
typename Label_,
bool parallel_>
46std::vector<Label_> load_labels(byteme::Reader& reader) {
47 bool non_empty =
false;
49 std::vector<Label_> labels;
51 typename std::conditional<parallel_, byteme::PerByte<char>, byteme::PerByteParallel<char> >::type pb(&reader);
52 bool okay = pb.valid();
59 throw std::runtime_error(
"label index must be an integer");
61 labels.push_back(current);
64 }
else if (std::isdigit(x)) {
69 throw std::runtime_error(
"label index must be an integer");
74 labels.push_back(current);
80template<
typename Label_>
81std::vector<Label_> load_labels(byteme::Reader& reader,
bool parallel) {
83 return load_labels<Label_, true>(reader);
85 return load_labels<Label_, false>(reader);
107template<
typename Label_ = singlepp::DefaultLabel>
109 byteme::RawFileReader reader(path, options.
buffer_size);
110 return internal::load_labels<Label_>(reader, options.
parallel);
123template<
typename Label_ = singlepp::DefaultLabel>
125 byteme::GzipFileReader reader(path, options.
buffer_size);
126 return internal::load_labels<Label_>(reader, options.
parallel);
140template<
typename Label_ = singlepp::DefaultLabel>
142 byteme::ZlibBufferReader reader(buffer, len, 3, options.
buffer_size);
143 return internal::load_labels<Label_>(reader, options.
parallel);