class CPersistProperties

This class helps you manage a collection of properties to be persisted. This class does all the work necessary to exchange property values between the user-defined buffer and the persistence medium.

To use the CPersistProperties class

  1. Declare an instance of the class.

  2. Add properties using AddProp.

  3. Use EnablePropSave to designate that a property should be saved. All properties are enabled for saving by default.

  4. Call Load and Save to persist to the desired medium.

  5. Use IsPropSaved to query whether a property is saved after a Load or Save.

  6. Use GetVersionPersisted to determine the version number of loaded properties.

A property is identified by its offset in the user buffer (see AddProp). Once persisted, the user buffer should not be modified where the offset of existing properties are changed. You can add new properties to the user buffer as long as you don’t modify existing property offsets. If you modify the existing property offsets, then you should change the stream ID to invalidate previously persisted streams.

Change the version number as desired to distinguish the current version of the properties from those previously persisted. Properties will continue to load if the existing version is the same or higher than previous versions. If the current version is lower than the persisted version, then the properties will not load.

All methods of the base class CArray are available.