home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / listpm7.zip / glbwrap.hpp < prev    next >
Text File  |  1999-06-12  |  3KB  |  78 lines

  1. /*
  2.     listPM list files under Presentation Manager. Uses Open Class Libarary.
  3.     Copyright (C) 1996, 1999  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.     PMB # 181
  21.     11900 Metric Blvd Ste. J
  22.     Austin Tx 78758-3117
  23.     pelliott@io.com
  24. */
  25. #ifndef GLBWRAP
  26. #define GLBWRAP
  27.  
  28. #include <ibase.hpp>
  29.  
  30. #include "Ltper.hpp"
  31. #include "LtProf.hpp"
  32.  
  33. // make int into a trivial class for External Existance.
  34. typedef BuiltIn<int> CBoolean;
  35.  
  36. // External Existance which holds Booleans indicating word wrapping.
  37. typedef ExternalExistance<CBoolean,Boolean> ExternalBoolean;
  38.  
  39. class ExternalWrap
  40.  
  41. {
  42.       private:
  43.                  ProfStorage         storage;
  44.                  ExternalBoolean     wrap_existance;
  45.       public:
  46.                  // construct source of external storage
  47.                  ExternalWrap() :
  48.                      storage("listpm","application_ini","word_wrap"),
  49.                      wrap_existance(storage)
  50.                  {
  51.                  };
  52.                  virtual ~ExternalWrap() {};              // destructor
  53.  
  54.                  // returns true when key exists in profile.
  55.                  Boolean wrapExternal(void)
  56.                  { return wrap_existance.ExistsExternally(); };
  57.  
  58.                  // get WW option stored externally.
  59.                  operator Boolean()
  60.                  {
  61.                     ExternalBoolean::Created created(wrap_existance);
  62.                     CBoolean& it = created;
  63.                     return it;
  64.  
  65.                  };
  66.  
  67.                  // Store Boolean in profile.
  68.                  ExternalWrap& operator<<(const Boolean& size)
  69.                  {
  70.                     CBoolean wsize(size);
  71.                     wrap_existance << wsize;
  72.                     return *this;
  73.                  };
  74.  
  75.  
  76. };
  77. #endif // GLBWRAP
  78.