1 // Copyright (c) 1994 James Clark 2 // See the file COPYING for copying permission. 3 #pragma ident "%Z%%M% %I% %E% SMI" 4 5 #ifndef InternalInputSource_INCLUDED 6 #define InternalInputSource_INCLUDED 1 7 #ifdef __GNUG__ 8 #pragma interface 9 #endif 10 11 #include <stddef.h> 12 #include "InputSource.h" 13 #include "Allocator.h" 14 #include "StringC.h" 15 #include "types.h" 16 17 #ifdef SP_NAMESPACE 18 namespace SP_NAMESPACE { 19 #endif 20 21 class InputSourceOrigin; 22 class Messenger; 23 class NamedCharRef; 24 25 class SP_API InternalInputSource : public InputSource { 26 public: new(size_t sz,Allocator & alloc)27 void *operator new(size_t sz, Allocator &alloc) { return alloc.alloc(sz); } new(size_t sz)28 void *operator new(size_t sz) { return Allocator::allocSimple(sz); } delete(void * p)29 void operator delete(void *p) { Allocator::free(p); } 30 InternalInputSource(const StringC &, InputSourceOrigin *); 31 Xchar fill(Messenger &); 32 void pushCharRef(Char ch, const NamedCharRef &); 33 Boolean rewind(Messenger &); 34 ~InternalInputSource(); 35 private: 36 InternalInputSource(const InternalInputSource &); // undefined 37 void operator=(const InternalInputSource &); // undefined 38 Char *buf_; 39 const StringC *contents_; 40 }; 41 42 #ifdef SP_NAMESPACE 43 } 44 #endif 45 46 #endif /* not InternalInputSource_INCLUDED */ 47