Skip to content
Snippets Groups Projects
Commit c07849b9 authored by Jakub Janák's avatar Jakub Janák
Browse files

converted to lowercase

parent 494a966e
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ int Controller::run(int argc, char *argv[]) {
}
void Controller::load_instance(const std::string &file_name) {
std::unique_ptr<TSInstance> tsInstance = FileManager::readDotFile(FileManager::INSTANCES_PATH + "/" + file_name);
std::unique_ptr<TSInstance> tsInstance = FileManager::read_dot_file(FileManager::INSTANCES_PATH + "/" + file_name);
if (tsInstance == nullptr) {
return;
}
......@@ -107,8 +107,8 @@ void Controller::load_instance(const std::string &file_name) {
void Controller::auto_load_instances() {
std::cout << "Loading all instances from " << FileManager::INSTANCES_PATH << " automatically" << std::endl;
for (const auto &entry: FileManager::getDotInstances(FileManager::INSTANCES_PATH)) {
std::unique_ptr<TSInstance> tsInstance = FileManager::readDotFile(entry.path().string());
for (const auto &entry: FileManager::get_dot_instances(FileManager::INSTANCES_PATH)) {
std::unique_ptr<TSInstance> tsInstance = FileManager::read_dot_file(entry.path().string());
this->unsolvedInstances.push_back(std::move(tsInstance));
}
}
......
......@@ -17,7 +17,7 @@ const std::string FileManager::INSTANCES_PATH = "../files/instances";
const std::string FileManager::RESULTS_PATH = "../files/results";
std::unique_ptr<TSInstance> FileManager::readDotFile(const std::string &file_name) {
std::unique_ptr<TSInstance> FileManager::read_dot_file(const std::string &file_name) {
// graphviz context
GVC_t *gvc = gvContext();
......@@ -88,7 +88,7 @@ std::unique_ptr<TSInstance> FileManager::readDotFile(const std::string &file_nam
return std::make_unique<TSInstance>(std::move(nodes), std::move(edges));
}
std::vector<std::filesystem::directory_entry> FileManager::getDotInstances(const std::string& directory_path) {
std::vector<std::filesystem::directory_entry> FileManager::get_dot_instances(const std::string& directory_path) {
std::vector<std::filesystem::directory_entry> entries;
for (const auto &entry: std::filesystem::directory_iterator(directory_path)) {
if (entry.is_regular_file() && entry.path().extension() == ".dot") {
......@@ -99,7 +99,7 @@ std::vector<std::filesystem::directory_entry> FileManager::getDotInstances(const
return entries;
}
void FileManager::saveSolution(const std::string &file_name, const std::string &file_content) {
void FileManager::save_solution(const std::string &file_name, const std::string &file_content) {
// creating the results folder if not exists
if (!std::filesystem::exists(RESULTS_PATH)) {
if (std::filesystem::create_directory(RESULTS_PATH)) {
......
......@@ -16,11 +16,11 @@ public:
static const std::string RESULTS_PATH;
static std::unique_ptr<TSInstance> readDotFile(const std::string &file_name);
static std::unique_ptr<TSInstance> read_dot_file(const std::string &file_name);
static std::vector<std::filesystem::directory_entry> getDotInstances(const std::string &directory_path);
static std::vector<std::filesystem::directory_entry> get_dot_instances(const std::string &directory_path);
static void saveSolution(const std::string& file_name, const std::string& file_content);
static void save_solution(const std::string& file_name, const std::string& file_content);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment