InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PrtMemMemoryXferBytes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __PrtMemMemoryXferBytes_h__
25 #define __PrtMemMemoryXferBytes_h__
26 
27 // Interface/General includes:
28 #include "IXferBytes.h" /* This is NOT an boss interface. */
29 
30 
37 {
38 public:
42 
45  virtual ~PrtMemMemoryXferBytes(void);
46 
47  //--- The IXferBytes interface we must implement ---
48 
51  virtual uint32 Read(void* buffer, uint32 num);
52 
55  virtual uint32 Write(void* buffer, uint32 num);
56 
59  virtual uint64 Seek(int64 numberOfBytes, SeekFromWhere fromHere);
60 
63  virtual void Flush(void);
64 
67  virtual StreamState GetStreamState(void);
68 
71  virtual void SetEndOfStream(void);
72 
73 protected:
74  const uint8* getBufferPtr(void) const;
75  void resizeBuffer(uint32 newSize);
76  void dumpState(void) const;
77 
78 private:
79 
80  StreamState fStreamState;
81  uint32 fCountBytesStored;
82  uint32 fAbsolutePositionInBuffer;
83  uint8* fMyBuffer;
84  uint32 fCurrentMaxBuf;
85 
86  enum
87  {
88  ePrtMemInitialMaxBuf = 1024*1024
89  };
90 };
91 
92 #endif // __PrtMemMemoryXferBytes_h__
93 
94 // End, PrtMemMemoryXferBytes.h.