summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-09-05 14:45:51 +0200
committerMatthias Melcher <github@matthiasm.com>2023-09-05 14:45:57 +0200
commit6bb5a81cee7e76e8a4e69f7f49869f39c1c382f0 (patch)
tree2a6d6f73dd19dd52aaccd1d99b50a20bb53946d6 /FL
parentb2a41e08c3b9b5fbbd0c899537611b8e28e5993d (diff)
Adds some convenience methods.
fl_filename_absolute can no generate a path using arbitrary source paths. Fl_Menu_ adds find_item_with_user_data and find_item_with_argument Fl_String adds find(string, start)
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Menu_.H2
-rw-r--r--FL/Fl_String.H1
-rw-r--r--FL/filename.H3
3 files changed, 6 insertions, 0 deletions
diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H
index 66bd9c64c..a30c870ea 100644
--- a/FL/Fl_Menu_.H
+++ b/FL/Fl_Menu_.H
@@ -73,6 +73,8 @@ public:
const Fl_Menu_Item* picked(const Fl_Menu_Item*);
const Fl_Menu_Item* find_item(const char *name);
const Fl_Menu_Item* find_item(Fl_Callback*);
+ const Fl_Menu_Item* find_item_with_user_data(void*);
+ const Fl_Menu_Item* find_item_with_argument(long);
int find_index(const char *name) const;
int find_index(const Fl_Menu_Item *item) const;
int find_index(Fl_Callback *cb) const;
diff --git a/FL/Fl_String.H b/FL/Fl_String.H
index e0280f43c..dc0d8307a 100644
--- a/FL/Fl_String.H
+++ b/FL/Fl_String.H
@@ -113,6 +113,7 @@ public:
Fl_String &operator+=(const char *src);
Fl_String &operator+=(const Fl_String &src);
Fl_String &operator+=(char c);
+ int find(const Fl_String &needle, int start_pos=0) const;
Fl_String &replace(int at, int n_del, const char *src, int n_ins=npos);
Fl_String &replace(int at, int n_del, const Fl_String &src);
Fl_String substr(int pos=0, int n=npos) const;
diff --git a/FL/filename.H b/FL/filename.H
index 3d9da0294..be7e90ead 100644
--- a/FL/filename.H
+++ b/FL/filename.H
@@ -63,7 +63,9 @@ FL_EXPORT Fl_String fl_filename_ext(const Fl_String &filename);
FL_EXPORT Fl_String fl_filename_setext(const Fl_String &filename, const Fl_String &new_extension);
FL_EXPORT Fl_String fl_filename_expand(const Fl_String &from);
FL_EXPORT Fl_String fl_filename_absolute(const Fl_String &from);
+FL_EXPORT Fl_String fl_filename_absolute(const Fl_String &from, const Fl_String &base);
FL_EXPORT Fl_String fl_filename_relative(const Fl_String &from);
+FL_EXPORT Fl_String fl_filename_relative(const Fl_String &from, const Fl_String &base);
FL_EXPORT Fl_String fl_getcwd();
# endif
@@ -75,6 +77,7 @@ FL_EXPORT Fl_String fl_getcwd();
inline char *fl_filename_setext(char *to, const char *ext) { return fl_filename_setext(to, FL_PATH_MAX, ext); }
inline int fl_filename_expand(char *to, const char *from) { return fl_filename_expand(to, FL_PATH_MAX, from); }
+FL_EXPORT int fl_filename_absolute(char *to, int tolen, const char *from, const char *cwd);
inline int fl_filename_absolute(char *to, const char *from) { return fl_filename_absolute(to, FL_PATH_MAX, from); }
FL_EXPORT int fl_filename_relative(char *to, int tolen, const char *from, const char *cwd);
inline int fl_filename_relative(char *to, const char *from) { return fl_filename_relative(to, FL_PATH_MAX, from); }