-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e877d97
commit af1aa9a
Showing
9 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Created by pedro on 25/12/23. | ||
// | ||
|
||
#include "FolderManagment.hpp" | ||
|
||
std::string FolderManagment::get_model_folder() { | ||
auto home_folder = get_home_folder(); | ||
return home_folder + "/model"; | ||
} | ||
|
||
std::string FolderManagment::get_img_folder() { | ||
auto home_folder = get_home_folder(); | ||
return home_folder + "/img"; | ||
} | ||
|
||
std::string FolderManagment::get_config_file() { | ||
auto home_folder = get_home_folder(); | ||
return home_folder + "/config.ini"; | ||
} | ||
|
||
std::string FolderManagment::get_home_folder() { | ||
std::string homeDir = getenv("HOME"); | ||
|
||
if (homeDir.empty()) { | ||
homeDir = getpwuid(getuid())->pw_dir; | ||
} | ||
|
||
// Nome da pasta oculta | ||
std::string hiddenFolderName = ".visualisador-rostos"; | ||
|
||
// Caminho completo para a nova pasta oculta | ||
std::string hiddenFolderPath = homeDir + "/" + hiddenFolderName; | ||
return hiddenFolderPath; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Created by pedro on 25/12/23. | ||
// | ||
|
||
#ifndef OPENCV_LEARN_FOLDERMANAGMENT_HPP | ||
#define OPENCV_LEARN_FOLDERMANAGMENT_HPP | ||
|
||
#include <string> | ||
#include <unistd.h> | ||
#include <pwd.h> | ||
|
||
|
||
class FolderManagment { | ||
public: | ||
static std::string get_model_folder(); | ||
static std::string get_img_folder(); | ||
static std::string get_config_file(); | ||
static std::string get_home_folder(); | ||
}; | ||
|
||
|
||
#endif //OPENCV_LEARN_FOLDERMANAGMENT_HPP |