cgv
Loading...
Searching...
No Matches
file_dialog.cxx
1#include "gui_driver.h"
2#include "file_dialog.h"
3
4namespace cgv {
5 namespace gui {
6
7std::string file_open_dialog(const std::string& title, const std::string& filter, const std::string& path)
8{
10 if (d.empty())
11 return "";
12 return d->file_open_dialog(title,filter,path);
13}
14
16std::string directory_open_dialog(const std::string& title, const std::string& path)
17{
19 if (d.empty())
20 return "";
21 return d->file_open_dialog(title,"",path);
22}
23
25std::string directory_save_dialog(const std::string& title, const std::string& path)
26{
28 if (d.empty())
29 return "";
30 return d->file_save_dialog(title,"",path);
31}
32
33
35std::string files_open_dialog(std::vector<std::string>& file_names, const std::string& title, const std::string& filter, const std::string& path)
36{
38 if (d.empty())
39 return "";
40 return d->files_open_dialog(file_names,title,filter,path);
41}
42
43
44std::string file_save_dialog(const std::string& title, const std::string& filter, const std::string& path)
45{
47 if (d.empty())
48 return "";
49 return d->file_save_dialog(title,filter,path);
50}
51
52 }
53}
reference counted pointer, which can work together with types that are derived from ref_counted,...
Definition ref_ptr.h:160
bool empty() const
check if pointer is not yet set
Definition ref_ptr.h:230
std::string file_open_dialog(const std::string &title, const std::string &filter, const std::string &path)
ask the user for a file name to open a file.
gui_driver_ptr get_gui_driver()
return the currently registered gui driver or an empty pointer if non has been registered
std::string directory_save_dialog(const std::string &title, const std::string &path)
ask the user for a new directory.
std::string directory_open_dialog(const std::string &title, const std::string &path)
ask the user for an existing directory.
std::string file_save_dialog(const std::string &title, const std::string &filter, const std::string &path)
ask the user for a file name to save a file.
std::string files_open_dialog(std::vector< std::string > &file_names, const std::string &title, const std::string &filter, const std::string &path)
ask user for an open dialog that can select multiple files, return common path prefix and fill field ...
the cgv namespace
Definition print.h:11