00001 /* 00002 * Copyright (c) 1997 00003 * Silicon Graphics Computer Systems, Inc. 00004 * 00005 * Permission to use, copy, modify, distribute and sell this software 00006 * and its documentation for any purpose is hereby granted without fee, 00007 * provided that the above copyright notice appear in all copies and 00008 * that both that copyright notice and this permission notice appear 00009 * in supporting documentation. Silicon Graphics makes no 00010 * representations about the suitability of this software for any 00011 * purpose. It is provided "as is" without express or implied warranty. 00012 * 00013 * Heavily modified by KOM/Darmstadt University of Technology, 2000 00014 */ 00015 #ifndef R_CHAR_PRODUCER_H 00016 #define R_CHAR_PRODUCER_H 00017 00022 // MNRopeCharProducers are logically functions that generate a section of 00023 // a string. These can be convereted to ropes. The resulting rope 00024 // invokes the MNRopeCharProducer on demand. This allows, for example, 00025 // files to be viewed as ropes without reading the entire file. 00026 class MNRopeCharProducer 00027 { 00028 public: 00029 virtual ~MNRopeCharProducer() {}; 00030 virtual void operator()(size_t __start_pos, size_t __len, 00031 uchar_t* __buffer) = 0; 00032 // Buffer should really be an arbitrary output iterator. 00033 // That way we could flatten directly into an ostream, etc. 00034 // This is thoroughly impossible, since iterator types don't 00035 // have runtime descriptions. 00036 }; 00037 00039 00040 #endif /* R_CHAR_PRODUCER_H */ 00041