Changeset 209

Show
Ignore:
Timestamp:
02/07/08 14:40:49 (4 years ago)
Author:
uncle_fungus
Message:

doxygenated preference

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.3.2beta3/src/include/preference.h

    r38 r209  
    1515*/ 
    1616 
     17/** 
     18 * \file preference.h 
     19 * Preference definition class. 
     20 * \author François Ingelrest 
     21 * \author Andrew Schofield 
     22 **/ 
     23 
    1724#ifndef _PREFERENCE_H 
    1825#define _PREFERENCE_H 
     
    2431 
    2532 
    26 // Storage class for the value of a preference 
     33/** 
     34 * Class for storing preference values. 
     35 **/ 
    2736class Preference 
    2837{ 
    2938protected: 
    30  
    31         // Order *MUST* not be changed 
    32         // This is for compatibility with older versions 
     39        /** 
     40         * Preference definition. 
     41         * The order must not be changed to maintain compatibility with older versions. 
     42         **/ 
    3343        enum _PREF_TYPE 
    3444        { 
    35                 PT_BOOL, 
    36                 PT_UINT, 
    37                 PT_INT, 
    38                 PT_DOUBLE, 
    39                 PT_STRING, 
    40                 PT_UNKNOWN, 
    41                 PT_HIDDEN_STRING        // Used for string that should not be directly "human-readable" from the disk 
     45                PT_BOOL, /**< Boolean preference */ 
     46                PT_UINT, /**< Unsigned integer preference */ 
     47                PT_INT, /**< Signed integer preference */ 
     48                PT_DOUBLE, /**< Double preference */ 
     49                PT_STRING, /**< String preference */ 
     50                PT_UNKNOWN, /**< Unknown preference */ 
     51                PT_HIDDEN_STRING /**< Hidden string. Used for string that should not be directly "human-readable" from the disk */ 
    4252        }; 
    4353 
    4454 
    45         PrefType mPrefType; 
    46         wxString mPrefName; 
    47         wxString mStringValue;      // Used for both PT_STRING and PT_HIDDEN_STRING 
    48         wxUint32 mUintValue; 
    49         wxInt32  mIntValue; 
    50         double   mDoubleValue; 
    51         bool     mBoolValue; 
     55        PrefType mPrefType; /**< The preference type */ 
     56        wxString mPrefName; /**< Preference name */ 
     57        wxString mStringValue; /**< String value. Used for both PT_STRING and PT_HIDDEN_STRING */ 
     58        wxUint32 mUintValue; /**< Unsigned integer value */ 
     59        wxInt32  mIntValue; /**< Signed integer value */ 
     60        double   mDoubleValue; /**< Double value */ 
     61        bool     mBoolValue; /**< Boolean value */ 
    5262 
    5363 
    5464public: 
     65        /** 
     66         * Null contructor. 
     67         **/ 
    5568        Preference(void); 
     69 
     70        /** 
     71         * Constructor for boolean prefs. 
     72         * @param name Preference name. 
     73         * @param value Boolean value 
     74         **/ 
    5675        Preference(wxString name, bool value); 
     76 
     77        /** 
     78         * Contructor for double prefs. 
     79         * @param name Preference name. 
     80         * @param value Double value 
     81         **/ 
    5782        Preference(wxString name, double value); 
     83 
     84        /** 
     85         * Contructor for signed integer prefs. 
     86         * @param name Preference name. 
     87         * @param value Int32 value 
     88         **/ 
    5889        Preference(wxString name, wxInt32 value); 
     90 
     91        /** 
     92         * Contructor for unsigned integer prefs. 
     93         * @param name Preference name. 
     94         * @param value Uint32 value 
     95         **/ 
    5996        Preference(wxString name, wxUint32 value); 
     97 
     98        /** 
     99         * Contructor for string and hidden string prefs. 
     100         * @param name Preference name. 
     101         * @param value string value 
     102         * @param isHidden Hidden state 
     103         **/ 
    60104        Preference(wxString name, const wxString& value, bool isHidden = false); 
    61105 
     106        /** 
     107         * Read the preference from the given input stream. 
     108         * @param in The input data stream. 
     109         **/ 
    62110        void Read(DataInputStream& in); 
     111 
     112        /** 
     113         * Write this preference to the given output stream. 
     114         * @param out The output data stream. 
     115         **/ 
    63116        void Write(DataOutputStream& out) const; 
    64117 
     118        /** 
     119         * Checks if preference is boolean. 
     120         **/ 
    65121        bool IsABoolPref(void)          const {return mPrefType == PT_BOOL;} 
     122 
     123        /** 
     124         * Checks if preference is a signed integer. 
     125         **/ 
    66126        bool IsAnIntPref(void)          const {return mPrefType == PT_INT;} 
     127 
     128        /** 
     129         * Checks if preference is an unsigned integer. 
     130         **/ 
    67131        bool IsAnUintPref(void)         const {return mPrefType == PT_UINT;} 
     132 
     133        /** 
     134         * Checks if preference is a double. 
     135         **/ 
    68136        bool IsADoublePref(void)        const {return mPrefType == PT_DOUBLE;} 
     137 
     138        /** 
     139         * Checks if preference is a string. 
     140         **/ 
    69141        bool IsAStringPref(void)        const {return mPrefType == PT_STRING;} 
     142 
     143        /** 
     144         * Checks if preference is an hidden string. 
     145         **/ 
    70146        bool IsAnHiddenStringPref(void) const {return mPrefType == PT_HIDDEN_STRING;} 
    71147 
    72148        // --- Getters 
     149        /** 
     150         * Get boolean value of preference. 
     151         **/ 
    73152        bool     GetBoolValue(void)         const {return mBoolValue;} 
     153 
     154        /** 
     155         * Get double value of preference. 
     156         **/ 
    74157        double   GetDoubleValue(void)       const {return mDoubleValue;} 
     158 
     159        /** 
     160         * Get int32 value of preference. 
     161         **/ 
    75162        wxInt32  GetIntValue(void)          const {return mIntValue;} 
     163 
     164        /** 
     165         * Get name of preference. 
     166         **/ 
    76167        wxString GetName(void)              const {return mPrefName;} 
     168 
     169        /** 
     170         * Get string value of preference. 
     171         **/ 
    77172        wxString GetStringValue(void)       const {return mStringValue;} 
     173 
     174        /** 
     175         * Get hidden string value of preference. 
     176         **/ 
    78177        wxString GetHiddenStringValue(void) const {return mStringValue;} 
     178 
     179        /** 
     180         * Get uint32 value of preference. 
     181         **/ 
    79182        wxUint32 GetUintValue(void)         const {return mUintValue;} 
    80183}; 
  • branches/2.3.2beta3/src/preference.cpp

    r148 r209  
    1515*/ 
    1616 
     17/** 
     18 * \file preference.cpp 
     19 * Preference definition class. 
     20 * \author François Ingelrest 
     21 * \author Andrew Schofield 
     22 **/ 
     23 
    1724#include "preference.h" 
    1825 
     
    2027 
    2128 
    22 /** 
    23 * Constructor 
    24 **/ 
    2529Preference::Preference(void) 
    2630{ 
     
    3034 
    3135 
    32 /** 
    33 * Constructor 
    34 **/ 
    3536Preference::Preference(wxString name, bool value) 
    3637{ 
     
    4142 
    4243 
    43 /** 
    44 * Constructor 
    45 **/ 
    4644Preference::Preference(wxString name, wxUint32 value) 
    4745{ 
     
    5250 
    5351 
    54 /** 
    55 * Constructor 
    56 **/ 
    5752Preference::Preference(wxString name, wxInt32 value) 
    5853{ 
     
    6358 
    6459 
    65 /** 
    66 * Constructor 
    67 **/ 
    6860Preference::Preference(wxString name, double value) 
    6961{ 
     
    7466 
    7567 
    76 /** 
    77 * Constructor 
    78 **/ 
    7968Preference::Preference(wxString name, const wxString& value, bool isHidden) 
    8069{ 
     
    9584 
    9685 
    97 /** 
    98 * Read the preference from the given input stream 
    99 **/ 
    10086void Preference::Read(DataInputStream& in) 
    10187{ 
     
    141127 
    142128 
    143 /** 
    144 * Write this preference to the given output stream 
    145 **/ 
    146129void Preference::Write(DataOutputStream& out) const 
    147130{