better parsing and readme
This commit is contained in:
parent
1e0bb72827
commit
cdd9d00a76
2 changed files with 13 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
MossMan is a tool designed to ease the filtering, viewing, and compilation of [Stanford MOSS](https://theory.stanford.edu/~aiken/moss/) reports. It is specialized for CMU's 15-122 programing course, generating the outline of a file that is read by another script. It could be used for other courses however.
|
MossMan is a tool designed to ease the filtering, viewing, and compilation of [Stanford MOSS](https://theory.stanford.edu/~aiken/moss/) reports. It is specialized for CMU's 15-122 programing course, generating the outline of a file that is read by another script. It could be used for other courses however.
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Adding images
|
## Adding images
|
||||||
|
|
|
||||||
|
|
@ -134,14 +134,24 @@ void LoadReport(std::string s, Fl_Text_Buffer * text, Fl_Text_Buffer * style) {
|
||||||
|
|
||||||
std::regex endcolorpatt("</FONT>(.*)");
|
std::regex endcolorpatt("</FONT>(.*)");
|
||||||
|
|
||||||
|
size_t count = 0;
|
||||||
while (std::getline(stream, line)) {
|
while (std::getline(stream, line)) {
|
||||||
|
if (count < 7) {
|
||||||
|
count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line == "</PRE>" || line == "</BODY>" || line == "</HTML>") {
|
||||||
|
count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
std::smatch matches;
|
std::smatch matches;
|
||||||
std::string formatted = htmlCodesToNormal(line);
|
std::string formatted = htmlCodesToNormal(line);
|
||||||
|
|
||||||
if(std::regex_search(formatted, matches, startcolorpatt)) {
|
if(std::regex_search(formatted, matches, startcolorpatt)) {
|
||||||
//std::cout << v << std::endl;
|
//std::cout << v << std::endl;
|
||||||
currentval = NumberToStyle(std::stoi(matches[1]));
|
currentval = NumberToStyle(std::stoi(matches[1]));
|
||||||
|
count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,6 +168,7 @@ void LoadReport(std::string s, Fl_Text_Buffer * text, Fl_Text_Buffer * style) {
|
||||||
for (size_t i = 0; i < formatted.length()+1; i++) {
|
for (size_t i = 0; i < formatted.length()+1; i++) {
|
||||||
style->append(currentval.c_str());
|
style->append(currentval.c_str());
|
||||||
}
|
}
|
||||||
|
count++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue