42 memcpy(*bufp,
name, 14);
49 memcpy(
name, *bufp, 14);
55 std::deque<int32_t> &file_ids) {
58 std::vector<Filesystem::Dirent> listing;
60 if (!fs->exists(path))
63 fs->readdir(path, listing);
65 for (
size_t i=0; i<listing.size(); i++) {
67 for (ptr=listing[i].name.c_str(); ptr; ++ptr) {
72 if (*ptr == 0 || (ptr > listing[i].name.c_str() && !strcmp(ptr,
".bad")))
73 id = atoi(listing[i].name.c_str());
76 HT_WARNF(
"Invalid META LOG file name encountered '%s', skipping...",
77 listing[i].name.c_str());
81 file_ids.push_back(
id);
85 sort(file_ids.begin(), file_ids.end(),
86 [](int32_t lhs, int32_t rhs) {
return lhs > rhs; });
#define HT_WARNF(msg,...)
Abstract base class for a filesystem.
uint16_t decode_i16(const uint8_t **bufp, size_t *remainp)
Decode a 16-bit integer in little-endian order.
Compatibility Macros for C/C++.
void encode_i16(uint8_t **bufp, uint16_t val)
Encode a 16-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
std::shared_ptr< Filesystem > FilesystemPtr
Smart pointer to Filesystem.