Making fl_filename_... public for std::string.

New functions append "_str" to the function name to
avoid ambiguities when calling them. So
'char *fl_filename_name(const char *)' becomes
'std::string fl_filename_name_str(const std::string &)'
This commit is contained in:
Matthias Melcher
2025-03-07 20:26:03 +01:00
parent 70e5dc23ae
commit 1186b4e255
8 changed files with 67 additions and 226 deletions
+11 -13
View File
@@ -72,20 +72,18 @@ FL_EXPORT int fl_filename_isdir(const char *name);
FL_EXPORT int fl_filename_absolute(char *to, int tolen, const char *from, const char *cwd);
FL_EXPORT int fl_filename_relative(char *to, int tolen, const char *from, const char *cwd);
#include <string>
// FIXME: We can't do this in 1.4.x - enable this block in 1.5 or higher.
// See fluid/fluid_filename.{h|cxx} for an implementation using Fl_String.
// FL_EXPORT std::string fl_filename_name(const std::string &filename);
// FL_EXPORT std::string fl_filename_path(const std::string &filename);
// FL_EXPORT std::string fl_filename_ext(const std::string &filename);
// FL_EXPORT std::string fl_filename_setext(const std::string &filename, const std::string &new_extension);
// FL_EXPORT std::string fl_filename_expand(const std::string &from);
// FL_EXPORT std::string fl_filename_absolute(const std::string &from);
// FL_EXPORT std::string fl_filename_absolute(const std::string &from, const std::string &base);
// FL_EXPORT std::string fl_filename_relative(const std::string &from);
// FL_EXPORT std::string fl_filename_relative(const std::string &from, const std::string &base);
// FL_EXPORT std::string fl_getcwd();
FL_EXPORT std::string fl_filename_name_str(const std::string &filename);
FL_EXPORT std::string fl_filename_path_str(const std::string &filename);
FL_EXPORT std::string fl_filename_ext_str(const std::string &filename);
FL_EXPORT std::string fl_filename_setext_str(const std::string &filename, const std::string &new_extension);
FL_EXPORT std::string fl_filename_expand_str(const std::string &from);
FL_EXPORT std::string fl_filename_absolute_str(const std::string &from);
FL_EXPORT std::string fl_filename_absolute_str(const std::string &from, const std::string &base);
FL_EXPORT std::string fl_filename_relative_str(const std::string &from);
FL_EXPORT std::string fl_filename_relative_str(const std::string &from, const std::string &base);
FL_EXPORT std::string fl_getcwd_str();
# endif /* defined(__cplusplus) */