diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-10-22 19:30:37 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-10-22 19:35:17 +0200 |
| commit | 1209e9dcd7e1e97bedc747d06ba4eea837562158 (patch) | |
| tree | 7897d3c61368958f191bfe684b96d1d08467a2bb /FL/Fl_Preferences.H | |
| parent | 05ac0247cbd902f910fa89f8d4f4fde9de904b0f (diff) | |
Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
selected functions and methods
Experimental, may be removed before release:
- use either Fl_Int_Vector or std::vector in Fl_Table depending
on CMake OPTION_USE_STD or configure --enable-use_std
Move all fl_filename* functions that use Fl_String to fluid
Main changes in fluid:
- add fluid_filename.h and .cxx
- include "fluid_filename.h" rather than <FL/filename.H>
Update fl_input(), fl_password() and test/ask
- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
std::string if enabled (FLTK_USE_STD)
Diffstat (limited to 'FL/Fl_Preferences.H')
| -rw-r--r-- | FL/Fl_Preferences.H | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index adf976706..98cc42523 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -25,6 +25,9 @@ # include "fl_attr.h" //class Fl_String; +#if (FLTK_USE_STD) +#include <string> +#endif /** \brief Fl_Preferences store user settings between application starts. @@ -241,7 +244,6 @@ public: char set( const char *entry, double value, int precision ); char set( const char *entry, const char *value ); char set( const char *entry, const void *value, int size ); -// char set( const char *entry, const Fl_String &value ); char get( const char *entry, int &value, int defaultValue ); char get( const char *entry, float &value, float defaultValue ); @@ -251,8 +253,15 @@ public: char get( const char *entry, void *&value, const void *defaultValue, int defaultSize ); char get( const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize ); char get( const char *entry, void *value, const void *defaultValue, int defaultSize, int *size ); + +// char set( const char *entry, const Fl_String &value ); // char get( const char *entry, Fl_String &value, const Fl_String &defaultValue ); +#if (FLTK_USE_STD) + char set( const char *entry, const std::string &value ); + char get( const char *entry, std::string &value, const std::string &defaultValue ); +#endif + int size( const char *entry ); char get_userdata_path( char *path, int pathlen ); |
