Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cRTFReader.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cRTFReader_H_
6 #define _INC_cRTFReader_H_
7 #ifndef NO_PRAGMA_ONCE
8 #pragma once
9 #endif
10 
11 #include "../GrayLibBase.h"
16 
17 namespace GrayLib
18 {
20  {
23 #define CRTFProp(a,b,c,d,e) RTF_PROP_##a,
24 #include "CRTFProps.tbl"
25 #undef CRTFProp
27  };
28 
30  {
32  };
34  {
36  };
37  enum RTF_RDS_t
38  {
42  };
43 
44  struct CRTF_State;
45 
47  {
51  HRESULT ParseMain(cStreamInput& strIn);
52 
53  public:
54  static const int k_STATE_SAVE_QTY = 32;
55 
56  private:
57  int m_nStateSaveIndex;
58  bool m_fSkipDestIfUnk;
59  long m_cbBin;
60  long m_lParam;
61 
62  private:
63  HRESULT onEndGroupAction(RTF_RDS_t rds);
64  HRESULT PushState(void);
65  HRESULT PopState(void);
66 
67  HRESULT ApplyKeyword_IDest(RTF_IDEST_t idest);
68  HRESULT ApplyKeyword_IPen(RTF_IPEN_t ipfn);
69  HRESULT ApplyKeyword_Prop(RTF_PROP_t iprop, int val);
70 
71  HRESULT ParseChar(char ch);
72  HRESULT ParseKeywordN(const char* pszKeyword, int param, bool fParam);
73  HRESULT ParseKeyword(cStreamInput& strIn);
74 
75  protected:
76  virtual HRESULT onPrintChar(char ch);
77 
78  public:
79  cRTFReader();
80  virtual ~cRTFReader();
81 
82  HRESULT ReadStream(cStreamInput& strIn);
83  HRESULT LoadFile(const FILECHAR_t* pszPath);
84 
86  };
87 };
88 #endif // _INC_cRTFReader_H_
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cRTFReader.h:47
UNITTEST_FRIEND(cRTFReader)
Definition: cStream.h:306
Definition: cMesh.h:22
RTF_IPEN_t
Definition: cRTFReader.h:30
@ RTF_IPEN_Hex
Definition: cRTFReader.h:31
@ RTF_IPEN_Bin
Definition: cRTFReader.h:31
@ RTF_IPEN_SkipDest
Definition: cRTFReader.h:31
RTF_IDEST_t
Definition: cRTFReader.h:34
@ RTF_IDEST_Pict
Definition: cRTFReader.h:35
@ RTF_IDEST_Skip
Definition: cRTFReader.h:35
RTF_RDS_t
Definition: cRTFReader.h:38
@ RTF_RDS_Skip
Definition: cRTFReader.h:41
@ RTF_RDS_Norm
Definition: cRTFReader.h:41
RTF_PROP_t
Definition: cRTFReader.h:20
@ RTF_PROP_QTY
Definition: cRTFReader.h:26
char FILECHAR_t
a UTF8 char in a file name. like TCHAR
Definition: FileName.h:22