Skip to content

Commit 5c4ef9a

Browse files
committed
Added documentation
1 parent 6dc27b3 commit 5c4ef9a

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

Example/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ SOFTWARE.
2626

2727
#include <ModernFileDialogs.h>
2828

29-
//#define SaveFileExamples 1
30-
//#define OpenFileExamples 1
29+
#define SaveFileExamples 1
30+
#define OpenFileExamples 1
3131
#define SelectFolderExamples 1
3232

3333
int main()

ModernFileDialogs/ModernFileDialogs.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@ SOFTWARE.
3535
#include <shlobj.h>
3636
#include <conio.h>
3737
#include <direct.h>
38-
#define SLASH "\\"
3938
#else
4039
#include <limits.h>
4140
#include <unistd.h>
4241
#include <dirent.h>
4342
#include <termios.h>
4443
#include <sys/utsname.h>
4544
#include <signal.h>
46-
#define SLASH "/"
4745
#endif
4846

4947
//-------------------------------------------------------------------------------------------------------------------//

ModernFileDialogs/ModernFileDialogs.h

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,42 +28,72 @@ SOFTWARE.
2828
#include <string>
2929
#include <vector>
3030

31-
//TODO Document
32-
//TODO Multiple filters under the same name should be splitted by ';'s
33-
//TODO Example: {"SomeFile", "*.SF;*.SomeFile}
31+
/// <summary>
32+
/// Open a Save File Dialog.
33+
/// </summary>
34+
/// <param name="title">Title for the Dialog.</param>
35+
/// <param name="defaultPathAndFile">Sets a default path and file.</param>
36+
/// <param name="filterPatterns">File filters (Separate multiple extensions for the same filter with a ';'. Example: {"Test File", "*.Test;*.TS"}.</param>
37+
/// <param name="allFiles">Whether to add a filter for "All Files (*.*)" or not.</param>
38+
/// <returns>Path of the Dialog or empty string.</returns>
3439
std::string SaveFile(const std::string& title,
3540
const std::string& defaultPathAndFile = "",
3641
const std::vector<std::pair<std::string, std::string>>& filterPatterns = {},
3742
bool allFiles = true);
3843

3944
//-------------------------------------------------------------------------------------------------------------------//
40-
//
41-
//TODO Document
42-
//TODO Multiple filters under the same name should be splitted by ';'s
43-
//TODO Example: {"SomeFile", "*.SF;*.SomeFile}
45+
46+
/// <summary>
47+
/// Opens an Open File Dialog.
48+
/// </summary>
49+
/// <param name="title">Title for the Dialog.</param>
50+
/// <param name="defaultPathAndFile">Sets a default path and file.</param>
51+
/// <param name="filterPatterns">File filters (Separate multiple extensions for the same filter with a ';'. Example: {"Test File", "*.Test;*.TS"}.</param>
52+
/// <param name="allowMultipleSelects">Whether to allow multiple file selections or not.</param>
53+
/// <param name="allFiles">Whether to add a filter for "All Files (*.*)" or not.</param>
54+
/// <returns>Path(s) of the Dialog or empty string or vector.</returns>
4455
std::vector<std::string> OpenFile(const std::string& title,
4556
const std::string& defaultPathAndFile = "",
4657
const std::vector<std::pair<std::string, std::string>>& filterPatterns = {},
4758
bool allowMultipleSelects = false,
4859
bool allFiles = true);
4960

50-
//TODO Document
51-
//TODO Single file alias for OpenFile
61+
/// <summary>
62+
/// Opens an Open File Dialog for a single file.<br>
63+
/// Alias for OpenFile();
64+
/// </summary>
65+
/// <param name="title">Title for the Dialog.</param>
66+
/// <param name="defaultPathAndFile">Sets a default path and file.</param>
67+
/// <param name="filterPatterns">File filters (Separate multiple extensions for the same filter with a ';'. Example: {"Test File", "*.Test;*.TS"}.</param>
68+
/// <param name="allFiles">Whether to add a filter for "All Files (*.*)" or not.</param>
69+
/// <returns>Path of the Dialog or empty string.</returns>
5270
std::string OpenSingleFile(const std::string& title,
5371
const std::string& defaultPathAndFile = "",
5472
const std::vector<std::pair<std::string, std::string>>& filterPatterns = {},
5573
bool allFiles = true);
5674

57-
//TODO Document
58-
//TODO Multi file alias for OpenFile
75+
/// <summary>
76+
/// Opens an Open File Dialog for multiple files.<br>
77+
/// Alias for OpenFile();
78+
/// </summary>
79+
/// <param name="title">Title for the Dialog.</param>
80+
/// <param name="defaultPathAndFile">Sets a default path and file.</param>
81+
/// <param name="filterPatterns">File filters (Separate multiple extensions for the same filter with a ';'. Example: {"Test File", "*.Test;*.TS"}.</param>
82+
/// <param name="allFiles">Whether to add a filter for "All Files (*.*)" or not.</param>
83+
/// <returns>Paths of the Dialog or empty vector.</returns>
5984
std::vector<std::string> OpenMultipleFiles(const std::string& title,
6085
const std::string& defaultPathAndFile = "",
6186
const std::vector<std::pair<std::string, std::string>>& filterPatterns = {},
6287
bool allFiles = true);
6388

6489
//-------------------------------------------------------------------------------------------------------------------//
6590

66-
//TODO Document
91+
/// <summary>
92+
/// Opens an Select Folder Dialog.
93+
/// </summary>
94+
/// <param name="title">Title for the Dialog.</param>
95+
/// <param name="defaultPath">Sets a default path and file.</param>
96+
/// <returns>Path of the Select Folder Dialog or empty string.</returns>
6797
std::string SelectFolder(const std::string& title, const std::string& defaultPath = "");
6898

6999
#endif /*_GAMESTRAP_MODERNFILEDIALOGS_H_*/

0 commit comments

Comments
 (0)