1#ifndef YAZE_APP_CORE_PROJECT_H
2#define YAZE_APP_CORE_PROJECT_H
9#include "absl/status/status.h"
27 absl::Status
Create(
const std::string& project_name) {
30 return absl::OkStatus();
35 return absl::InvalidArgumentError(
36 "Project fields cannot be empty. Please load a rom file, set your "
37 "code folder, and set your labels file. See HELP for more details.");
40 return absl::OkStatus();
42 absl::Status
Open(
const std::string &project_path);
56static constexpr absl::string_view kDefaultTypes[] = {
57 "Dungeon Names",
"Dungeon Room Names",
"Overworld Map Names"};
63 void EditLabel(
const std::string& type,
const std::string& key,
64 const std::string& newValue);
66 const std::string& key,
67 const std::string& defaultValue);
68 std::string
GetLabel(
const std::string& type,
const std::string& key);
69 std::string
CreateOrGetLabel(
const std::string& type,
const std::string& key,
70 const std::string& defaultValue);
79 std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
88 void AddFile(
const std::string& file_path) {
98 if (!file.is_open()) {
103 file << file_path << std::endl;
109 if (!file.is_open()) {
115 while (std::getline(file, line)) {
std::vector< std::string > recent_files_
RecentFilesManager(const std::string &filename)
const std::vector< std::string > & GetRecentFiles() const
void AddFile(const std::string &file_path)
Main namespace for the application.
constexpr char kEndOfProjectFile[]
const std::string kRecentFilesFilename
Represents a project in the application.
absl::Status Open(const std::string &project_path)
absl::Status Create(const std::string &project_name)
absl::Status CheckForEmptyFields()
std::string keybindings_file
std::string rom_filename_
std::string labels_filename_
std::string display_description
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > labels_
void EditLabel(const std::string &type, const std::string &key, const std::string &newValue)
bool LoadLabels(const std::string &filename)
std::string GetLabel(const std::string &type, const std::string &key)
std::string CreateOrGetLabel(const std::string &type, const std::string &key, const std::string &defaultValue)
void DisplayLabels(bool *p_open)
void SelectableLabelWithNameEdit(bool selected, const std::string &type, const std::string &key, const std::string &defaultValue)