PM Library classes

class PMProfile

? ^ 
    extends PMNonCopyable as public

Profile management class.

Class that an application would use to query or write user-specific initialization files.

You can construct and destruct objects of this class.

Source:
pm_profile.h:25
Author:
Dmitry A.Steklenev
Version:
$Revision: 1.5 $

Contents

^ 
EntityInherited FromTypeScopeShort Description
PMProfileconstructor public Constructs a profile object.
PMProfileconstructor publicConstructs a profile object of a current module.
PMProfileconstructor publicConstructs a profile object from an existing profile handle.
~PMProfiledestructor publicDestructs the profile object.
put_datamethod public This method writes a binary data into the profile.
put_integermethod public This method writes a long integer value into the profile.
put_integermethod public This method writes a unsigned long integer value into the profile.
put_integermethod public This method writes a short integer value into the profile.
put_integermethod public This method writes a unsigned short integer value into the profile.
put_stringmethod public This method writes a character string into the profile.
get_sizemethod public Returns the size in bytes of the value of a specified key for a specified application in the profile.
get_datamethod public Returns a binary data from the profile.
get_integermethod public Returns a long integer value from the profile.
get_integermethod public Returns a unsigned long integer value from the profile.
get_integermethod public Returns a short integer value from the profile.
get_integermethod public Returns a unsigned short integer value from the profile.
get_stringmethod public Returns a character string from the profile.
window_optionsenum public Use these enumerators to to specify window save and restore options.
save_windowmethod public Saves the current size and position of the window.
rest_windowmethod public Restores the size and position of the window.
INI_SECTIONmacro publicDefines a section name for easy way profile macros.
save_stringmacro publicEasy way to save a characters string to the profile.
save_integermacro publicEasy way to save a integer value to the profile.
load_stringmacro publicEasy way to restore a characters string from the profile.
load_integermacro publicEasy way to restore a integer value from the profile.

constructor PMProfile

? ^  > 
Constructs a profile object.

Source:
pm_profile.h:38
Param:
filename User-profile file name. This must not be the same as the current user (OS2.INI) or system initialization (OS2SYS.INI) file name.
Code:
public PMProfile ( const char * filename )

constructor PMProfile

? ^  < > 
Constructs a profile object of a current module.
Source:
pm_profile.h:41
Code:
public PMProfile ( )

constructor PMProfile

? ^  < > 
Constructs a profile object from an existing profile handle.
Source:
pm_profile.h:44
Code:
public PMProfile ( HINI handle )

destructor ~PMProfile

? ^  < > 
Destructs the profile object.
Source:
pm_profile.h:47
Code:
public ~ PMProfile ( )

method put_data

? ^  < > 
This method writes a binary data into the profile.

Source:
pm_profile.h:66
Params:
app Application name. The case-dependent name of the application for which profile data is to be written. Names starting with the characters "PM_" are reserved for system use.
key The case-dependent name of the key for which profile data is to be written. This parameter can be NULL in which case all the key or data pairs associated with app are deleted.
data Value data. If this parameter is NULL, the data associated with the key parameter is deleted.
len The size of the data to be written. This length should not exceed 64K bytes.
Code:
public void put_data ( const char * app ,
const char * key ,
const void * data ,
unsigned long len )

method put_integer

? ^  < > 
This method writes a long integer value into the profile.

Source:
pm_profile.h:79
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value The long integer value.

Also see more detailed description of the put_data parameters.

Code:
public void put_integer ( const char * app ,
const char * key ,
long value )

method put_integer

? ^  < > 
This method writes a unsigned long integer value into the profile.

Source:
pm_profile.h:92
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value The unsigned long integer value.

Also see more detailed description of the put_data parameters.

Code:
public void put_integer ( const char * app ,
const char * key ,
unsigned long value )

method put_integer

? ^  < > 
This method writes a short integer value into the profile.

Source:
pm_profile.h:105
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value The short integer value.

Also see more detailed description of the put_data parameters.

Code:
public void put_integer ( const char * app ,
const char * key ,
short value )

method put_integer

? ^  < > 
This method writes a unsigned short integer value into the profile.

Source:
pm_profile.h:118
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value The unsigned short integer value.

Also see more detailed description of the put_data parameters.

Code:
public void put_integer ( const char * app ,
const char * key ,
unsigned short value )

method put_string

? ^  < > 
This method writes a character string into the profile.

Source:
pm_profile.h:131
Params:
app The case-dependent application name.
key The case-dependent name of the key.
string Pointer to a text string that ends with a null character.

Also see more detailed description of the put_data parameters.

Code:
public void put_string ( const char * app ,
const char * key ,
const char * string )

method get_size

? ^  < > 
Returns the size in bytes of the value of a specified key for a specified application in the profile.

Source:
pm_profile.h:156
Params:
app The name of the application for which the profile data is required.

If the app parameter is NULL, then the method returns the length of the buffer required to hold the enumerated list of application names, as returned by the get_data method when its app parameter is NULL. In this case, the key parameter is ignored.

key Key name. The name of the key for which the size of the data is to be returned.

If the key parameter is NULL, and if the app parameter is not NULL, the method returns the length of the buffer required to hold the enumerated list of key names for that application name, as returned by the get_data method when its key parameter is NULL, and its app parameter is not NULL.

Returns:
The length of the value data related to the key parameter. If an error occurs, returns 0. The maximum size of data than can be returned is 64K bytes.
Code:
public unsigned long get_size ( const char * app ,
const char * key ) const

method get_data

? ^  < > 
Returns a binary data from the profile.

Source:
pm_profile.h:193
Params:
app Application name. The name of the application for which the profile data is required. The name must match exactly with the name stored in the profile. There is no case-independent searching.

If this parameter is NULL, this function enumerates all the application names present in the profile and returns the names as a list in the data parameter. Each application name is terminated with a NULL character and the last name is terminated with two successive NULL characters.

key Key name. The name of the key for which the profile data is required. The name must match exactly with the name stored in the profile. There is no case-independent searching.

If this parameter is NULL, and if app is not equal to NULL, this call enumerates all key names associated with the named application and returns the key names, but not their values, as a list in the data parameter. Each key name is terminated with a NULL character and the last name is terminated with two successive NULL characters.

data A buffer in which the value corresponding to the key name is returned.
len Size of value data. This is the size of the buffer specified by the data parameter. If the call is successful, this is overwritten with the number of bytes copied into the buffer. The maximum amount of data that can be returned is 64K bytes.

Returns:
Success indicator.
Code:
public BOOL get_data ( const char * app ,
const char * key ,
void * data ,
unsigned long * len ) const

method get_integer

? ^  < > 
Returns a long integer value from the profile.

Source:
pm_profile.h:208
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value Pointer to the long integer value.

Also see more detailed description of the get_data parameters.

Returns:
Success indicator.
Code:
public BOOL get_integer ( const char * app ,
const char * key ,
long * value ) const

method get_integer

? ^  < > 
Returns a unsigned long integer value from the profile.

Source:
pm_profile.h:223
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value Pointer to the unsigned long integer value.

Also see more detailed description of the get_data parameters.

Returns:
Success indicator.
Code:
public BOOL get_integer ( const char * app ,
const char * key ,
unsigned long * value ) const

method get_integer

? ^  < > 
Returns a short integer value from the profile.

Source:
pm_profile.h:238
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value Pointer to the short integer value.

Also see more detailed description of the get_data parameters.

Returns:
Success indicator.
Code:
public BOOL get_integer ( const char * app ,
const char * key ,
short * value ) const

method get_integer

? ^  < > 
Returns a unsigned short integer value from the profile.

Source:
pm_profile.h:253
Params:
app The case-dependent application name.
key The case-dependent name of the key.
value Pointer to the unsigned short integer value.

Also see more detailed description of the get_data parameters.

Returns:
Success indicator.
Code:
public BOOL get_integer ( const char * app ,
const char * key ,
unsigned short * value ) const

method get_string

? ^  < > 
Returns a character string from the profile.

Source:
pm_profile.h:269
Params:
app The case-dependent application name.
key The case-dependent name of the key.
string The text string obtained from the profile.
len Maximum string length.

Also see more detailed description of the get_data parameters.

Returns:
Success indicator.
Code:
public BOOL get_string ( const char * app ,
const char * key ,
char * string ,
unsigned long len ) const

enum window_options

? ^  < > 
Use these enumerators to to specify window save and restore options.

map_points
Maps points from dialog coordinates to window coordinates, or from window coordinates to dialog coordinates.
Source:
pm_profile.h:282
Code:
public enum window_options { map_points = 0x0001 }

method save_window

? ^  < > 
Saves the current size and position of the window.

Saves the current size and position of the window specified by hwnd. This function will also save the presentation parameters.

Source:
pm_profile.h:297
Params:
app The case-dependent application name.
key The case-dependent name of the key.
hwnd Window handle for the window to be stored.
options Options.
Code:
public BOOL save_window ( const char * app ,
const char * key ,
HWND hwnd ,
int options )

method rest_window

? ^  < > 
Restores the size and position of the window.

Restores the size and position of the window specified by hwnd to the state it was in when save_window was last called. This function will also restore presentation parameters.

Source:
pm_profile.h:313
Params:
app The case-dependent application name.
key The case-dependent name of the key.
hwnd Window handle for the window to be stored.
options Options.
Code:
public BOOL rest_window ( const char * app ,
const char * key ,
HWND hwnd ,
int options )

macro INI_SECTION

? ^  < > 
Defines a section name for easy way profile macros.
Source:
pm_profile.h:318
Code:
public define INI_SECTION "Settings"

macro save_string

? ^  < > 
Easy way to save a characters string to the profile.
Source:
pm_profile.h:323
Code:
public define save_string ( var ) put_string ( INI_SECTION , # var , var )

macro save_integer

? ^  < > 
Easy way to save a integer value to the profile.
Source:
pm_profile.h:326
Code:
public define save_integer ( var ) put_integer ( INI_SECTION , # var , var )

macro load_string

? ^  < > 
Easy way to restore a characters string from the profile.
Source:
pm_profile.h:329
Code:
public define load_string ( var ) get_string ( INI_SECTION , # var , var , sizeof ( var ) )

macro load_integer

? ^  < > 
Easy way to restore a integer value from the profile.
Source:
pm_profile.h:332
Code:
public define load_integer ( var ) get_integer ( INI_SECTION , # var , & var )

Created Fri Aug 3 09:13:16 2012.
This documentation was generated automatically by
ccdoc v08r39 2003/02/27 bin_opt_emx_os2-2.30.
Click here to submit a bug report or feature request for ccdoc.
Click here to return to the top of the page.