#include "support/lassert.h"
#include "support/lstrings.h"
-#include "support/bind.h"
#include "support/regex.h"
#include "support/TempFile.h"
string const & desc, string const & prereq,
string const & category, bool texclassavail)
{
- name_ = fn;
+ name_ = onlyFileName(fn);
+ path_ = fn.rfind('/') == string::npos ? string() : onlyPath(fn);
latexname_ = cln;
description_ = desc;
prerequisites_ = prereq;
// which uses the following regex
// \Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}
ifstream ifs(layout_file.toFilesystemEncoding().c_str());
- static regex const reg("^#\\s*\\\\Declare(LaTeX|DocBook)Class\\s*"
+ static regex const reg("^\\s*#\\s*\\\\Declare(LaTeX|DocBook)Class\\s*"
"(?:\\[([^,]*)(?:,.*)*\\])*\\s*\\{(.*)\\}\\s*");
- static regex const catreg("^#\\s*\\\\DeclareCategory\\{(.*)\\}");
+ static regex const catreg("^\\s*#\\s*\\\\DeclareCategory\\{(.*)\\}\\s*");
string line;
string class_name;
string class_prereq;
return string();
LayoutFile * tmpl =
- new LayoutFile(textclass, class_name, textclass, class_prereq, category, true);
+ new LayoutFile(addName(moved ? oldpath : path, textclass),
+ class_name, textclass, class_prereq, category, true);
//FIXME: The prerequisites are available from the layout file and
// can be extracted from the above regex, but for now this
// field is simply set to class_name + ".cls"