home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / listpm.zip / source / glbwrap.hpp < prev    next >
Text File  |  1996-07-08  |  3KB  |  77 lines

  1. /*
  2.     listPM list files under Presentation Manager. Uses Open Class Libarary.
  3.     Copyright (C) 1996  Paul Elliott
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19.     Paul Elliott
  20.     3987 South Gessner #224
  21.     Houston Tx 77063
  22.     Paul.Elliott@Hrnowl.LoneStar.Org
  23. */
  24. #ifndef GLBWRAP
  25. #define GLBWRAP
  26.  
  27. #include <ibase.hpp>
  28.  
  29. #include "Ltper.hpp"
  30. #include "LtProf.hpp"
  31.  
  32. // make int into a trivial class for External Existance.
  33. typedef BuiltIn<int> CBoolean;
  34.  
  35. // External Existance which holds Booleans indicating word wrapping.
  36. typedef ExternalExistance<CBoolean,Boolean> ExternalBoolean;
  37.  
  38. class ExternalWrap
  39.  
  40. {
  41.       private:
  42.                  ProfStorage         storage;
  43.                  ExternalBoolean     wrap_existance;
  44.       public:
  45.                  // construct source of external storage
  46.                  ExternalWrap() :
  47.                      storage("listpm","application_ini","word_wrap"),
  48.                      wrap_existance(storage)
  49.                  {
  50.                  };
  51.                  virtual ~ExternalWrap() {};              // destructor
  52.  
  53.                  // returns true when key exists in profile.
  54.                  Boolean wrapExternal(void)
  55.                  { return wrap_existance.ExistsExternally(); };
  56.  
  57.                  // get WW option stored externally.
  58.                  operator Boolean()
  59.                  {
  60.                     ExternalBoolean::Created created(wrap_existance);
  61.                     CBoolean& it = created;
  62.                     return it;
  63.  
  64.                  };
  65.  
  66.                  // Store Boolean in profile.
  67.                  ExternalWrap& operator<<(const Boolean& size)
  68.                  {
  69.                     CBoolean wsize(size);
  70.                     wrap_existance << wsize;
  71.                     return *this;
  72.                  };
  73.  
  74.  
  75. };
  76. #endif // GLBWRAP
  77.