Half done with Scene Component Parsing

This commit is contained in:
2023-03-23 21:43:02 -07:00
parent 3782e731b2
commit 8c50c10be0
19 changed files with 308 additions and 411 deletions

View File

@@ -0,0 +1,59 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/File.hpp"
namespace Dawn {
enum DirectoryChildType {
DIRECTORY_CHILD_TYPE_FILE,
DIRECTORY_CHILD_TYPE_DIRECTORY
};
class Directory {
public:
std::string filename;
DIR *handle = nullptr;
Directory(std::string dir);
/**
* Opens a connection to the directory.
* @return True if success, otherwise for failure.
*/
bool_t open();
/**
* Returns if the directory is open.
* @return True if open, otherwise false.
*/
bool_t isOpen();
/**
* Closes the directory.
*/
void close();
/**
* Returns if the directory exists.
* @return True if exists, otherwise false.
*/
bool_t exists();
/**
* Creates the directory and all parent directories.
*/
void mkdirp();
/**
* Reads the directory and returns a list of files.
*
* @return List of filenames/directories within this directory.
*/
std::map<std::string, enum DirectoryChildType> readDirectory();
~Directory();
};
}