- FilePtr fp(f, FilePtr::read);
- if (fp()) { // file opened
- char nome[256];
- unsigned long one = 0;
- unsigned long two = 0;
- // scan the file line by line
- // return true if the two numbers on the line is different
- int ret = 0;
- while (!feof(fp())) {
- ret = fscanf(fp(), "%s %lu %lu",
- nome, &one, &two);
- if (ret !=3) continue;
- if (lyxerr.debugging()) {
- char tmp1[255];
- char tmp2[255];
- sprintf(tmp1, "%lu", one);
- sprintf(tmp2, "%lu", two);
- lyxerr.debug() << "read dep: "
- << nome << " " << tmp1
- << " " << tmp2 << endl;
- }
- insert(string(nome), false, one, two);
+ DepList tmp;
+ // we want const_iterator (Lgb)
+ for (DepList::iterator cit = deplist.begin();
+ cit != deplist.end(); ++cit) {
+ if (!suffixIs((*cit).first, suf))
+ tmp[(*cit).first] = (*cit).second;
+ }
+ deplist.swap(tmp);
+}
+
+
+void DepTable::write(string const & f) const
+{
+ ofstream ofs(f.c_str());
+ for (DepList::const_iterator cit = deplist.begin();
+ cit != deplist.end(); ++cit) {
+ if (lyxerr.debugging(Debug::DEPEND)) {
+ lyxerr << "Write dep: "
+ << (*cit).first << " "
+ << (*cit).second.first << " "
+ << (*cit).second.second << endl;