+ static regex const reg1("\\\\citation\\{([^}]+)\\}");
+ static regex const reg2("\\\\bibdata\\{([^}]+)\\}");
+ static regex const reg3("\\\\bibstyle\\{([^}]+)\\}");
+ static regex const reg4("\\\\@input\\{([^}]+)\\}");
+
+ while (getline(ifs, token)) {
+ token = rtrim(token, "\r");
+ smatch sub;
+ if (regex_match(token, sub, reg1)) {
+ string data = sub.str(1);
+ while (!data.empty()) {
+ string citation;
+ data = split(data, citation, ',');
+ lyxerr[Debug::LATEX] << "Citation: "
+ << citation << endl;
+ aux_info.citations.insert(citation);
+ }
+ } else if (regex_match(token, sub, reg2)) {
+ string data = sub.str(1);
+ // data is now all the bib files separated by ','
+ // get them one by one and pass them to the helper
+ while (!data.empty()) {
+ string database;
+ data = split(data, database, ',');
+ database = ChangeExtension(database, "bib");
+ lyxerr[Debug::LATEX] << "BibTeX database: `"
+ << database << '\'' << endl;
+ aux_info.databases.insert(database);
+ }
+ } else if (regex_match(token, sub, reg3)) {
+ string style = sub.str(1);
+ // token is now the style file
+ // pass it to the helper
+ style = ChangeExtension(style, "bst");
+ lyxerr[Debug::LATEX] << "BibTeX style: `"
+ << style << '\'' << endl;
+ aux_info.styles.insert(style);
+ } else if (regex_match(token, sub, reg4)) {
+ string const file2 = sub.str(1);
+ scanAuxFile(file2, aux_info);
+ }