Finished Language Generation Tool

This commit is contained in:
2023-02-15 18:02:49 -08:00
parent 984e3b1a73
commit 1179c96233
4 changed files with 166 additions and 5 deletions

View File

@ -33,14 +33,14 @@ namespace Dawn {
class File {
private:
enum FileMode mode;
size_t length;
public:
FILE *file = nullptr;
static std::string normalizeSlashes(std::string str);
static void mkdirp(std::string path);
std::string filename;
size_t length;
FILE *file = nullptr;
/**
* Constructs a new File interface class.
@ -95,6 +95,20 @@ namespace Dawn {
*/
bool_t readString(std::string *out);
/**
* Reads ahead from the current position to a specific needle (character).
*
* @param buffer Buffer to output read chars to.
* @param max Max length of the buffer / amount of chars to read ahead.
* @param needle The character (needle) to look for.
* @return Amount of chars read, or <= 0 on error.
*/
size_t readAhead(
char *buffer,
size_t max,
char needle
);
/**
* Writes the entire contents of a string to a file.
*
@ -111,6 +125,8 @@ namespace Dawn {
*/
bool_t writeRaw(char *data, size_t );
void setPosition(size_t pos);
~File();
};
}