InternalInputSource.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: InternalInputSource.h /main/1 1996/07/29 16:55:29 cde-hp $ */
  24. // Copyright (c) 1994 James Clark
  25. // See the file COPYING for copying permission.
  26. #ifndef InternalInputSource_INCLUDED
  27. #define InternalInputSource_INCLUDED 1
  28. #ifdef __GNUG__
  29. #pragma interface
  30. #endif
  31. #include <stddef.h>
  32. #include "InputSource.h"
  33. #include "Allocator.h"
  34. #include "StringC.h"
  35. #include "types.h"
  36. #ifdef SP_NAMESPACE
  37. namespace SP_NAMESPACE {
  38. #endif
  39. class InputSourceOrigin;
  40. class Messenger;
  41. class NamedCharRef;
  42. class InternalInputSource : public InputSource {
  43. public:
  44. void *operator new(size_t sz, Allocator &alloc) { return alloc.alloc(sz); }
  45. void *operator new(size_t sz) { return Allocator::allocSimple(sz); }
  46. void operator delete(void *p) { Allocator::free(p); }
  47. InternalInputSource(const StringC &, InputSourceOrigin *);
  48. Xchar fill(Messenger &);
  49. void pushCharRef(Char ch, const NamedCharRef &);
  50. Boolean rewind(Messenger &);
  51. ~InternalInputSource();
  52. private:
  53. InternalInputSource(const InternalInputSource &); // undefined
  54. void operator=(const InternalInputSource &); // undefined
  55. Char *buf_;
  56. const StringC *contents_;
  57. };
  58. #ifdef SP_NAMESPACE
  59. }
  60. #endif
  61. #endif /* not InternalInputSource_INCLUDED */