home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / BoxMaker++ / BoxMaker++ ƒ / preferences.h < prev    next >
Encoding:
Text File  |  1995-01-20  |  837 b   |  37 lines  |  [TEXT/KAHL]

  1. //
  2. // preferences is a template for a preferences file
  3. //
  4. template<class C> class preferences : public C
  5. {
  6.     public:
  7.         enum
  8.         {
  9.             kFourQuestionMarks = 0x3F3F3F3F
  10.         };
  11.         preferences( Str255 fName, const C &defaults,
  12.                     OSType fileCreator = kFourQuestionMarks);
  13.  
  14.         ~preferences();
  15.  
  16.     private:
  17.         FSSpec theFileSpec;
  18.         const OSType iFileCreator;
  19.         //
  20.         // theDefaults holds a copy of the default settings, as found in the
  21.         // preferences file or in the default settings. The destructor compares
  22.         // it to the current settings. If they differ the current settings are
  23.         // written to the preferences file.
  24.         //
  25.         C theDefaults;
  26.  
  27.         enum
  28.         {
  29.             kPreferencesInfo = -16397
  30.         };
  31.         //
  32.         // defaultsChanged returns true when the default settings
  33.         // have changed from the ones past to the constructor.
  34.         //
  35.         Boolean defaultsChanged() const;
  36. };
  37.