home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / profile / basicpro / basicpro.cpp next >
Text File  |  1996-10-29  |  1KB  |  47 lines

  1. //************************************************************
  2. // Basic Profile Example
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <iprofile.hpp>
  9. #include <iostream.h>
  10.  
  11. int main()
  12. {
  13.  
  14. #ifdef IC_PM
  15.    IProfile  profile ( "Jennware.ini" );
  16. #else
  17.    IProfile  profile ( "Jenn's Software" );
  18. #endif
  19.  
  20.    profile.addOrReplaceElementWithKey ("Bitmap",
  21.                                        "horse.bmp",
  22.                                        "Visual Jenn" );
  23.  
  24.    profile.addOrReplaceElementWithKey ("User count",
  25.                                        61368,
  26.                                        "Visual Jenn" );
  27.  
  28.    cout << "The key value pairs are:  " << endl;
  29.  
  30.    IProfile::Cursor cursor (profile, "Visual Jenn");
  31.    for (cursor.setToFirst();
  32.         cursor.isValid();
  33.         cursor.setToNext())
  34.    {
  35.        IString keyName = profile.applicationOrKeyAt (cursor);
  36.  
  37.        cout << keyName << ":  ";
  38.  
  39.        if (keyName == "User count")
  40.           cout << profile.integerWithKey (keyName,"Visual Jenn") << endl;
  41.        else
  42.           cout << profile.elementWithKey (keyName,"Visual Jenn") << endl;
  43.    }
  44.  
  45.  
  46. }
  47.