-void Converters::UpdateLast(Formats const & formats)
-{
- if (converterlist.begin() != converterlist.end()) {
- ConverterList::iterator it = converterlist.end()-1;
- it->From = formats.GetFormat(it->from);
- it->To = formats.GetFormat(it->to);
- }
-}
-
-
-void Converters::Sort()
-{
- sort(converterlist.begin(), converterlist.end());
-}
-
-
-int Converters::BFS_init(string const & start, bool clear_visited)
-{
- int s = formats.GetNumber(start);
- if (s < 0)
- return s;
-
- Q = queue<int>();
- if (clear_visited)
- fill(visited.begin(), visited.end(), false);
- if (visited[s] == false) {
- Q.push(s);
- visited[s] = true;
- }
- return s;
-}
-
-
-vector<Format const *> const
-Converters::GetReachableTo(string const & target, bool clear_visited)
-{
- vector<Format const *> result;
- int s = BFS_init(target, clear_visited);
- if (s < 0)
- return result;
-
- while (!Q.empty()) {
- int i = Q.front();
- Q.pop();
- if (i != s || target != "lyx")
- result.push_back(&formats.Get(i));
- for (vector<int>::iterator it = vertices[i].in_vertices.begin();
- it != vertices[i].in_vertices.end(); ++it)
- if (!visited[*it]) {
- visited[*it] = true;
- Q.push(*it);
- }
- }
-
- return result;
-}
-
-
-vector<Format const *> const
-Converters::GetReachable(string const & from, bool only_viewable,
- bool clear_visited)