1#ifndef YAZE_APP_CORE_PROJECT_H
2#define YAZE_APP_CORE_PROJECT_H
9#include "absl/status/status.h"
29 absl::Status
Create(
const std::string& project_name) {
32 return absl::OkStatus();
37 return absl::InvalidArgumentError(
38 "Project fields cannot be empty. Please load a rom file, set your "
39 "code folder, and set your labels file. See HELP for more details.");
42 return absl::OkStatus();
44 absl::Status
Open(
const std::string &project_path);
58static constexpr absl::string_view kDefaultTypes[] = {
59 "Dungeon Names",
"Dungeon Room Names",
"Overworld Map Names"};
65 void EditLabel(
const std::string& type,
const std::string& key,
66 const std::string& newValue);
68 const std::string& key,
69 const std::string& defaultValue);
70 std::string
GetLabel(
const std::string& type,
const std::string& key);
71 std::string
CreateOrGetLabel(
const std::string& type,
const std::string& key,
72 const std::string& defaultValue);
81 std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
90 void AddFile(
const std::string& file_path) {
100 if (!file.is_open()) {
105 file << file_path << std::endl;
111 if (!file.is_open()) {
117 while (std::getline(file, line)) {
const std::vector< std::string > & GetRecentFiles() const
RecentFilesManager(const std::string &filename)
void AddFile(const std::string &file_path)
std::vector< std::string > recent_files_
A class to manage experimental feature flags.
const std::string kRecentFilesFilename
constexpr char kEndOfProjectFile[]
Represents a project in the application.
absl::Status Open(const std::string &project_path)
std::string labels_filename_
std::string keybindings_file
absl::Status CheckForEmptyFields()
absl::Status Create(const std::string &project_name)
std::string rom_filename_
std::string display_description
std::string CreateOrGetLabel(const std::string &type, const std::string &key, const std::string &defaultValue)
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > labels_
void DisplayLabels(bool *p_open)
void SelectableLabelWithNameEdit(bool selected, const std::string &type, const std::string &key, const std::string &defaultValue)
std::string GetLabel(const std::string &type, const std::string &key)
void EditLabel(const std::string &type, const std::string &key, const std::string &newValue)
bool LoadLabels(const std::string &filename)