From adb6fc4eeb0d73481a1368531f8593c485fd5c91 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 30 Apr 2002 22:25:18 +0000 Subject: added binary support and procedural names to Fl_Preferences, updated FLUID, update documentation. Attempted to strip all Win32 CR. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2146 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/Fl_Preferences.html | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'documentation') diff --git a/documentation/Fl_Preferences.html b/documentation/Fl_Preferences.html index 966cf08e2..b5a30623c 100644 --- a/documentation/Fl_Preferences.html +++ b/documentation/Fl_Preferences.html @@ -10,7 +10,7 @@

Class Hierarchy

Include Files

@@ -65,6 +65,7 @@ method.
  • groups
  • set
  • size
  • +
  • Name
  • @@ -133,19 +134,21 @@ deleting the base preferences flushes automatically. that is usable for application data beyond what is covered by Fl_Preferences. -

    int get(const char *entry, int &value,   int defaultValue)
    -int get(const char *entry, int &value,    int defaultValue)
    -int get(const char *entry, float &value,  float defaultValue)
    -int get(const char *entry, double &value, double defaultValue ) -int get(const char *entry, char *&value,  const char *defaultValue)
    -int get(const char *entry, char *value,   const char *defaultValue, +

    int get(const char *entry, int &value, int defaultValue)
    +int get(const char *entry, int &value, int defaultValue)
    +int get(const char *entry, float &value, float defaultValue)
    +int get(const char *entry, double &value, double defaultValue )
    +int get(const char *entry, char *&text, const char *defaultValue)
    +int get(const char *entry, char *text, const char *defaultValue, int maxSize)
    +int get(const char *entry, void *&data, const void *defaultValue, int defaultSize)
    +int get(const char *entry, void *data, const void *defaultValue, int defaultSize, int maxSize)

    Reads an entry from the group. A default value must be supplied. The return value indicates if the value was available (non-zero) or the default was used (0). If the 'char -*&value' form is used, the resulting text must be freed -with 'free(value)'. +*&text' or 'void *&data' form is used, +the resulting data must be freed with 'free(value)'.

    const char *Fl_Preferences::group(int ix)

    @@ -167,10 +170,10 @@ group. int set(const char *entry, int value)
    int set(const char *entry, float value)
    int set(const char *entry, double value)
    -int set(const char *entry, const char *value) +int set(const char *entry, const char *text)
    +int set(const char *entry, const void *data, int size) -

    Sets an entry (name/value pair). Text data must not contain -any '\n' or '\r' characters. The return value indicates if there +

    Sets an entry (name/value pair). The return value indicates if there was a problem storing the data in memory. However it does not reflect if the value was actually stored in the preferences file. @@ -179,6 +182,18 @@ file.

    Returns the size of the value part of an entry. +

    +Fl_Preferences::Name( unsigned int numericName )
    +Fl_Preferences::Name( const char *format, ... ) +

    + +

    'Name' provides a simple method to create numerical or more complex +procedural names for entries and groups on the fly, +i.e. prefs.set(Fl_Preferences::Name("File%d",i),file[i]);. +See test/preferences.cxx as a sample for writing arrays into preferences.

    +'Name' is actually implemented as a class inside Fl_Preferences. It casts +into const char* and gets automatically destroyed after the enclosing call. + -- cgit v1.2.3