Dekko
MarkdownToken.h
1 #ifndef MARKDOWNTOKEN_H
2 #define MARKDOWNTOKEN_H
3 
5 {
6 public:
8  ~MarkdownToken();
9 
10  enum TokenType {
11  Unknown = -1,
12  AtxHeading1,
13  AtxHeading2,
14  AtxHeading3,
15  AtxHeading4,
16  AtxHeading5,
17  AtxHeading6,
18  SetextHead1Line1,
19  SetextHead1Line2,
20  SetextHead2Line1,
21  SetextHead2Line2,
22  Emphasis,
23  Strong,
24  Strikethrough,
25  Verbatim,
26  HtmlTag,
27  HtmlEntity,
28  AutomaticLink,
29  InlineLink,
30  ReferenceLink,
31  ReferenceDefinition,
32  Image,
33  HtmlComment,
34  NumberedList,
35  BulletList,
36  HorizontalRule,
37  Blockquote,
38  CodeBlock,
39  GFMCodeFence,
40  CodeFenceEnd,
41  Mention,
42  TableHeader,
43  TableDiv,
44  TablePipe,
45  Last
46  };
47 
48  TokenType type() const;
49  void setType(TokenType t);
50 
51  int position() const;
52  void setPosition(int pos) { m_position = pos; }
53 
54  int length() const;
55  void setLength(int len);
56 
57  int openingLength() const;
58  void setOpeningLenth(int len);
59 
60  int closingLength() const;
61  void setClosingLength(int len);
62 
63  const bool operator < (const MarkdownToken &t) const {
64  return m_position < t.position();
65  }
66 
67  const bool operator > (const MarkdownToken &t) const {
68  return m_position > t.position();
69  }
70 
71 private:
72  TokenType m_type;
73  int m_position;
74  int m_length;
75  int m_opening;
76  int m_closing;
77 };
78 
79 #endif // MARKDOWNTOKEN_H
MarkdownToken
Definition: MarkdownToken.h:4