Advancing along here.

This commit is contained in:
Brad Arant 2020-12-09 09:43:52 -08:00
parent 5bd9e9ca21
commit c3c9530b4b
5 changed files with 39 additions and 37 deletions

View File

@ -10,13 +10,13 @@ namespace coreutils {
public:
Directory(std::string path) {
dir = opendir(path.c_str());
if(dir) {
struct dirent *entry = readdir(dir);
while(entry) {
directory.emplace(std::string(entry->d_name), entry);
entry = readdir(dir);
}
dir = opendir(path.c_str());
if(dir) {
struct dirent *entry = readdir(dir);
while(entry) {
directory.emplace(std::string(entry->d_name), entry);
entry = readdir(dir);
}
}
if(directory.size() > 0)
cursor = directory.begin();

View File

@ -9,13 +9,13 @@ namespace coreutils {
public:
DirectoryEntry(struct dirent *entry) {
memcpy(&this->entry, entry, sizeof(struct dirent));
memcpy(&this->entry, entry, sizeof(struct dirent));
}
~DirectoryEntry() {}
std::string getName() {
return std::string(entry.d_name);
return std::string(entry.d_name);
}
private:

View File

@ -23,7 +23,7 @@ namespace coreutils {
}
File::~File() {
close(fd);
}
void File::setBufferSize(size_t size) {

View File

@ -16,6 +16,8 @@ namespace coreutils {
bool IMFMessage::parse(PString &in) {
coreutils::Log(coreutils::LOG_DEBUG_1) << "Parsing-------\n" << in.str();
while (!in.ifNext("\r\n")) {
headers.emplace_back(in);
}