Menu

[r72]: / framework / trunk / text_tool.h  Maximize  Restore  History

Download this file

30 lines (24 with data), 665 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef MARKDOWN_H
#define MARKDOWN_H
#include <string>
using std::string;
class Text_Tool {
// State definitions:
enum { NOTHING, QUOTE, CODE, UL, OL, P, FINISH };
enum { L_BLANK, L_TEXT, L_H, L_QUOTE, L_CODE, L_UL, L_OL ,L_EOF };
int state;
int input;
size_t ptr;
string content;
int header_level;
void getline(string &s);
void init();
void to_html(string s);
void basic_to_html(string s);
public:
void markdown2html(char const *in,string &out);
void markdown2html(string &in,string &out) { markdown2html(in.c_str(),out);};
void text2html(char const *s,string &);
void text2html(string &s,string &out) { text2html(s.c_str(),out);};
};
#endif
MongoDB Logo MongoDB