1#ifndef YAZE_APP_CORE_PROJECT_H
2#define YAZE_APP_CORE_PROJECT_H
9#include "absl/status/status.h"
26 absl::Status
Create(
const std::string& project_name) {
29 return absl::OkStatus();
34 return absl::InvalidArgumentError(
35 "Project fields cannot be empty. Please load a rom file, set your "
36 "code folder, and set your labels file. See HELP for more details.");
39 return absl::OkStatus();
41 absl::Status
Open(
const std::string& project_path);
55static constexpr absl::string_view kDefaultTypes[] = {
56 "Dungeon Names",
"Dungeon Room Names",
"Overworld Map Names"};
62 void EditLabel(
const std::string& type,
const std::string& key,
63 const std::string& newValue);
65 const std::string& key,
66 const std::string& defaultValue);
67 std::string
GetLabel(
const std::string& type,
const std::string& key);
68 std::string
CreateOrGetLabel(
const std::string& type,
const std::string& key,
69 const std::string& defaultValue);
78 std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
87 void AddFile(
const std::string& file_path) {
97 if (!file.is_open()) {
102 file << file_path << std::endl;
108 if (!file.is_open()) {
114 while (std::getline(file, line)) {
131 absl::Status
Commit(
const std::string& message);
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)
absl::Status Commit(const std::string &message)
std::string repository_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)