-bool LyX::loadFiles()
-{
- LATTEST(!use_gui);
- bool success = true;
- vector<string>::const_iterator it = pimpl_->files_to_load_.begin();
- vector<string>::const_iterator end = pimpl_->files_to_load_.end();
-
- for (; it != end; ++it) {
- // get absolute path of file and add ".lyx" to
- // the filename if necessary
- FileName fname = fileSearch(string(), os::internal_path(*it), "lyx",
- may_not_exist);
-
- if (fname.empty())
- continue;
-
- Buffer * buf = pimpl_->buffer_list_.newBuffer(fname.absFileName());
- if (buf->loadLyXFile() == Buffer::ReadSuccess) {
- ErrorList const & el = buf->errorList("Parse");
- if (!el.empty())
- for_each(el.begin(), el.end(),
- bind(&LyX::printError, this, _1));
- }
- else {
- pimpl_->buffer_list_.release(buf);
- docstring const error_message =
- bformat(_("LyX failed to load the following file: %1$s"),
- from_utf8(fname.absFileName()));
- lyxerr << to_utf8(error_message) << endl;
- success = false;
- }
- }
- return success;
-}
-
-