⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.h

📁 pwlib源码库
💻 H
📖 第 1 页 / 共 2 页
字号:
    /** Delete the particular variable in the specified section. */    virtual void DeleteKey(      const PString & section,  /// Section to use instead of the default.      const PString & key       /// Key of the variable to delete.    );    /**Determine if the particular variable in the section is actually present.       This function allows a caller to distinguish between getting a saved       value or using the default value. For example if you called       GetString("MyKey", "DefVal") there is no way to distinguish between       the default "DefVal" being used, or the user had explicitly saved the       value "DefVal" into the PConfig.     */    virtual BOOL HasKey(      const PString & key       /// Key of the variable.    ) const;    /**Determine if the particular variable in the section is actually present. */    virtual BOOL HasKey(      const PString & section,  /// Section to use instead of the default.      const PString & key       /// Key of the variable.    ) const;  //@}  /**@name Get/Set variables */  //@{    /** Get a string variable determined by the key in the section. If the       section name is not specified then the default section is used.              If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case an empty string is       returned.       @return string value of the variable.     */    virtual PString GetString(      const PString & key       /// The key name for the variable.    ) const;    /** Get a string variable determined by the key in the section. */    virtual PString GetString(      const PString & key,      /// The key name for the variable.      const PString & dflt      /// Default value for the variable.    ) const;    /** Get a string variable determined by the key in the section. */    virtual PString GetString(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      const PString & dflt      /// Default value for the variable.    ) const;    /** Set a string variable determined by the key in the section. If the       section name is not specified then the default section is used.     */    virtual void SetString(      const PString & key,      /// The key name for the variable.      const PString & value     /// New value to set for the variable.    );    /** Set a string variable determined by the key in the section. */    virtual void SetString(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      const PString & value     /// New value to set for the variable.    );    /** Get a boolean variable determined by the key in the section. If the       section name is not specified then the default section is used.       The boolean value can be specified in a number of ways. The TRUE value       is returned if the string value for the variable begins with either the       'T' character or the 'Y' character. Alternatively if the string can       be converted to a numeric value, a non-zero value will also return TRUE.       Thus the values can be Key=True, Key=Yes or Key=1 for TRUE and       Key=False, Key=No, or Key=0 for FALSE.       If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case FALSE is returned.       @return boolean value of the variable.     */    virtual BOOL GetBoolean(      const PString & key,      /// The key name for the variable.      BOOL dflt = FALSE         /// Default value for the variable.    ) const;    /** Get a boolean variable determined by the key in the section. */    virtual BOOL GetBoolean(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      BOOL dflt = FALSE         /// Default value for the variable.    ) const;    /** Set a boolean variable determined by the key in the section. If the       section name is not specified then the default section is used.       If value is TRUE then the string "True" is written to the variable       otherwise the string "False" is set.     */    virtual void SetBoolean(      const PString & key,      /// The key name for the variable.      BOOL value                /// New value to set for the variable.    );    /** Set a boolean variable determined by the key in the section. */    virtual void SetBoolean(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      BOOL value                /// New value to set for the variable.    );    /* Get an integer variable determined by the key in the section. If the       section name is not specified then the default section is used.       If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case zero is returned.       @return integer value of the variable.     */    virtual long GetInteger(      const PString & key,      /// The key name for the variable.      long dflt = 0             /// Default value for the variable.    ) const;    /* Get an integer variable determined by the key in the section. */    virtual long GetInteger(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      long dflt = 0             /// Default value for the variable.    ) const;    /** Set an integer variable determined by the key in the section. If the       section name is not specified then the default section is used.       The value is always formatted as a signed number with no leading or       trailing blanks.     */    virtual void SetInteger(      const PString & key,      /// The key name for the variable.      long value                /// New value to set for the variable.    );    /** Set an integer variable determined by the key in the section. */    virtual void SetInteger(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      long value                /// New value to set for the variable.    );    /** Get a 64 bit integer variable determined by the key in the section. If the       section name is not specified then the default section is used.       If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case zero is returned.       @return integer value of the variable.     */    virtual PInt64 GetInt64(      const PString & key,      /// The key name for the variable.      PInt64 dflt = 0           /// Default value for the variable.    ) const;    /** Get a 64 bit integer variable determined by the key in the section. */    virtual PInt64 GetInt64(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      PInt64 dflt = 0           /// Default value for the variable.    ) const;    /** Set a 64 bit integer variable determined by the key in the section. If the       section name is not specified then the default section is used.       The value is always formatted as a signed number with no leading or       trailing blanks.     */    virtual void SetInt64(      const PString & key,      /// The key name for the variable.      PInt64 value              /// New value to set for the variable.    );    /** Set a 64 bit integer variable determined by the key in the section. */    virtual void SetInt64(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      PInt64 value              /// New value to set for the variable.    );    /** Get a floating point variable determined by the key in the section. If       the section name is not specified then the default section is used.       If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case zero is returned.       @return floating point value of the variable.     */    virtual double GetReal(      const PString & key,      /// The key name for the variable.      double dflt = 0           /// Default value for the variable.    ) const;    /** Get a floating point variable determined by the key in the section. */    virtual double GetReal(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      double dflt = 0           /// Default value for the variable.    ) const;    /** Set a floating point variable determined by the key in the section. If       the section name is not specified then the default section is used.       The value is always formatted as a signed decimal or exponential form       number with no leading or trailing blanks, ie it uses the %g formatter       from the printf() function.     */    virtual void SetReal(      const PString & key,      /// The key name for the variable.      double value              /// New value to set for the variable.    );    /** Set a floating point variable determined by the key in the section. */    virtual void SetReal(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      double value              /// New value to set for the variable.    );    /** Get a #PTime# variable determined by the key in the section. If       the section name is not specified then the default section is used.       If the key is not present the value returned is the that provided by       the #dlft# parameter. Note that this is different from the       key being present but having no value, in which case zero is returned.       @return time/date value of the variable.     */    virtual PTime GetTime(      const PString & key       /// The key name for the variable.    ) const;    /** Get a #PTime# variable determined by the key in the section. */    virtual PTime GetTime(      const PString & key,      /// The key name for the variable.      const PTime & dflt        /// Default value for the variable.    ) const;    /** Get a #PTime# variable determined by the key in the section. */    virtual PTime GetTime(      const PString & section,  /// Section to use instead of the default.      const PString & key       /// The key name for the variable.    ) const;    /** Get a #PTime# variable determined by the key in the section. */    virtual PTime GetTime(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      const PTime & dflt        /// Default value for the variable.    ) const;    /** Set a #PTime# variable determined by the key in the section. If       the section name is not specified then the default section is used.     */    virtual void SetTime(      const PString & key,      /// The key name for the variable.      const PTime & value       /// New value to set for the variable.    );    /** Set a #PTime# variable determined by the key in the section. */    virtual void SetTime(      const PString & section,  /// Section to use instead of the default.      const PString & key,      /// The key name for the variable.      const PTime & value       /// New value to set for the variable.    );  //@}  protected:    // Member variables    /// The current section for variable values.    PString defaultSection;  private:    // Do common construction code.    void Construct(      Source src,               /// Standard source for the configuration.      const PString & appname,  /// Name of application      const PString & manuf     /// Manufacturer    );    void Construct(      const PFilePath & filename  /// Explicit name of the configuration file.    );// Include platform dependent part of class#ifdef _WIN32#include "msos/ptlib/config.h"#else#include "unix/ptlib/config.h"#endif};#endif // P_CONFIG_FILE#endif// End Of File ///////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -