using support::addName;
using support::bformat;
-using support::makeAbsPath;
+using support::FileName;
using support::makeDisplayPath;
using support::onlyFilename;
using support::removeAutosaveFile;
}
+BufferList::iterator BufferList::begin()
+{
+ return bstore.begin();
+}
+
+
+BufferList::const_iterator BufferList::begin() const
+{
+ return bstore.begin();
+}
+
+
+BufferList::iterator BufferList::end()
+{
+ return bstore.end();
+}
+
+
+BufferList::const_iterator BufferList::end() const
+{
+ return bstore.end();
+}
+
+
bool BufferList::quitWriteBuffer(Buffer * buf)
{
BOOST_ASSERT(buf);
// if master/slave are both open, do not save slave since it
// will be automatically loaded when the master is loaded
if ((*it)->getMasterBuffer() == (*it))
- LyX::ref().session().lastOpened().add((*it)->fileName());
+ LyX::ref().session().lastOpened().add(FileName((*it)->fileName()));
}
return true;
{
auto_ptr<Buffer> tmpbuf(new Buffer(s, ronly));
tmpbuf->params().useClassDefaults();
- lyxerr[Debug::INFO] << "Assigning to buffer "
+ LYXERR(Debug::INFO) << "Assigning to buffer "
<< bstore.size() << endl;
bstore.push_back(tmpbuf.get());
return tmpbuf.release();
}
+Buffer * BufferList::last()
+{
+ if (bstore.empty())
+ return 0;
+ return bstore.back();
+}
+
+
Buffer * BufferList::getBuffer(unsigned int const choice)
{
if (choice >= bstore.size())
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
if (!(*it)->isDepClean(mastertmpdir)) {
- string writefile = mastertmpdir;
- writefile += '/';
- writefile += (*it)->getLatexName();
- (*it)->makeLaTeXFile(writefile, mastertmpdir,
+ string writefile = addName(mastertmpdir, (*it)->getLatexName());
+ (*it)->makeLaTeXFile(FileName(writefile), mastertmpdir,
runparams, false);
(*it)->markDepClean(mastertmpdir);
}
string s = buf->fileName();
s += ".emergency";
lyxerr << " " << s << endl;
- if (buf->writeFile(s)) {
+ if (buf->writeFile(FileName(s))) {
buf->markClean();
lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
string s = addName(package().home_dir(), buf->fileName());
s += ".emergency";
lyxerr << ' ' << s << endl;
- if (buf->writeFile(s)) {
+ if (buf->writeFile(FileName(s))) {
buf->markClean();
lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
s = addName(package().temp_dir(), buf->fileName());
s += ".emergency";
lyxerr << ' ' << s << endl;
- if (buf->writeFile(s)) {
+ if (buf->writeFile(FileName(s))) {
buf->markClean();
lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
}
-void BufferList::setCurrentAuthor(string const & name, string const & email)
+void BufferList::setCurrentAuthor(docstring const & name, docstring const & email)
{
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();