MCPcopy Index your code
hub / github.com/Uncodin/bypass / parse

Method parse

src/parser.cpp:89–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 }
88
89 Document Parser::parse(const char* mkd) {
90 document = Document();
91
92 if (mkd) {
93 struct buf *ib, *ob;
94
95 ib = bufnew(INPUT_UNIT);
96 bufputs(ib, mkd);
97
98 ob = bufnew(OUTPUT_UNIT);
99
100 mkd_callbacks.opaque = this;
101
102 //parse and assemble document
103 markdown(ob, ib, &mkd_callbacks);
104
105 for (std::map<int, Element>::iterator it = elementSoup.begin(); it != elementSoup.end(); ++it) {
106 document.append(it->second);
107 }
108
109 bufrelease(ib);
110 bufrelease(ob);
111 }
112
113 return document;
114 }
115
116 Document Parser::parse(const string& markdown) {
117 return parse(markdown.c_str());

Calls 6

bufnewFunction · 0.85
bufputsFunction · 0.85
markdownFunction · 0.85
bufreleaseFunction · 0.85
DocumentClass · 0.70
appendMethod · 0.45

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.64