๐Ÿ“ฆ luosiwei-cmd / Maticpouse

๐Ÿ“„ languageCheck.hpp ยท 81 lines
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81#ifndef languageCheck_hpp
#define languageCheck_hpp

#include<bits/stdc++.h>

class languageCheck{
public:
    languageCheck();
    void outputMarkdown(std::vector<std::string> & dests);
    void setTitle(std::string title);
    
    int run(std::vector<std::string>& content);
    int getContent(std::vector<std::string>& content);
    void printContent();
    int translate();
private:
    std::string ContentTitle;
    
    enum All_Statue{
        INCODE,
        NORMAL,
        INBLOCK,
        INTABLE,
        TABLE_FMT
    } status;
    
    std::string preReplace(std::string s);
    std::string getTime();
    
    std::vector<std::string> content;
    size_t contentLength;
    std::vector<std::string> output;
    
    int isToc(std::string s);
    std::string TocContent;
    struct Toc{int deep; std::string name;};
    bool needToc = 0;
    int TocNumber = 0;
    std::vector<struct Toc> Tocs;
    std::vector<std::string> TocString;
    void handleToc();
    
    bool needMathjax = 0;
    
    int isTitle(std::string s);
    int isHorizon(std::string s);
    
    std::string handleTitle(std::string s,int titleLevel);
    std::string handleHorizon();
    
    void handleUnList();
    int isUnList(std::string s);
    
    void handleList();
    int isList(std::string s);
    
    int BlockNumber = 0;
    int isBlock(std::string s);
    std::string handleBlock(std::string s,int number);
    int handleBlock_S(std::string s);
    
    int isBr(std::string s);
    
    int isCode(std::string s);
    void handletoken();
    
    int handleCode(std::string s);
    
    int TableNumber = 0;
    std::vector<std::string> aligns;
    int handleTable(std::string s);
    std::vector<std::string> getTableElem(std::string s);
    
    void handleFlow();
};




#endif /* languageCheck_hpp */