InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ParcelKey.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: dwaterfa
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 // Purpose of Interface:
24 //
25 //========================================================================================
26 
27 #ifndef __ParcelKey__
28 #define __ParcelKey__
29 
30 #ifdef ID_ENABLE_DEBUGGING
31 #include "PMString.h"
32 #endif
33 
34 class IPMStream;
35 
36 class ParcelKey
37 {
38  public:
39  ParcelKey();
40 
41  bool16 operator==(const ParcelKey& other) const
42  { return fV == other.fV; }
43 
44  bool16 operator!=(const ParcelKey& other) const
45  { return !(*this == other); }
46 
47  bool16 operator<(const ParcelKey& other) const
48  { return fV < other.fV; }
49 
50  bool16 IsValid() const
51  { return (this->fV != 0); }
52 
53  void SetInvalid()
54  { fV = 0; }
55 
56  void ReadWrite(IPMStream*);
57 
58 #ifdef ID_ENABLE_DEBUGGING
59  PMString ToHex() const
60  { char buf[10]; sprintf(buf, "0x%x", fV); return PMString(buf); }
61 
62  PMString ToDec() const
63  { char buf[10]; sprintf(buf, "%u", fV); return PMString(buf); }
64 #endif
65 
66  typedef base_type data_type;
67 
68  protected:
69  uint32 fV;
70 };
71 
72 #endif // __ParcelKey__
73