| 17 | vector<wstring> _samples; |
| 18 | |
| 19 | void readSamples(const string& file = "") { |
| 20 | string path = file; |
| 21 | if (path.empty()) path = LaTeX::getResRootPath() + "/SAMPLES.tex"; |
| 22 | string line = ""; |
| 23 | string sample = ""; |
| 24 | std::ifstream f(path); |
| 25 | if (f.is_open()) { |
| 26 | while (getline(f, line)) { |
| 27 | if (!line.empty() && |
| 28 | !isSpace(line) && |
| 29 | std::all_of(line.begin(), line.end(), [](char c) { return c == '%'; })) { |
| 30 | add(sample); |
| 31 | sample = ""; |
| 32 | } else { |
| 33 | if (!line.empty() && !isSpace(line)) sample += line + "\n"; |
| 34 | } |
| 35 | } |
| 36 | f.close(); |
| 37 | } |
| 38 | add(sample); |
| 39 | } |
| 40 | |
| 41 | void add(const string& str) { |
| 42 | if (str.empty()) return; |
nothing calls this directly
no outgoing calls
no test coverage detected