Skip to content

Commit

Permalink
docs: documented functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed May 2, 2024
1 parent ddd7a09 commit 5c20cef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions include/engine/utilities/file_management.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace utilities {

constexpr std::string_view hexwave_project_ext = ".hexw";

#ifndef WIN32
#ifndef _WIN32
/**
* @brief Linux File Reader.
*
Expand Down Expand Up @@ -42,15 +42,33 @@ class linux_file {
};
#endif

/**
* @brief Save the current project
*
* @param manager The video manager with the videos.
*
* @return bool true if project was able to save
*/
bool save_project(video_manager& manager);

/**
* @brief Load a project.
*
* @brief The video manager to load the videos to.
*
* @return bool true if project was loaded successfully.
*/
bool load_project(video_manager& manager);

/**
* @brief Opens a file prompt to retrieve a file path.
*
* @param is_save Is this prompt a save prompt?
* @param title The title of the prompt.
* @param linux_filters Filters for Linux (usually formatted as `name | filter`)
* @param windows_filters Filters for Windows (usually formatted as `name\0filter\0name\0filter\0`)
*
* @return
* @return std::string File path (includes file name, for example `/opt/hexwave/testing.hexw`
*/
std::string get_file_from_prompt(const bool is_save, const std::string& title, const std::string& linux_filters, const char* windows_filters);
}
1 change: 1 addition & 0 deletions src/engine/utilities/file_management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bool utilities::save_project(video_manager& manager) {

// Does filename NOT end in ".hexw"?
if(filename.compare(filename.size() - hexwave_project_ext.size(), hexwave_project_ext.size(), hexwave_project_ext) != 0) {
// because file doesn't end in ".hexw", we need to add ".hexw" to it to ensure all files end in that.
filename.append(hexwave_project_ext);
}

Expand Down

0 comments on commit 5c20cef

Please sign in to comment.