#include "ExternalTemplate.h"
-#include "debug.h"
+#include "support/debug.h"
#include "Lexer.h"
#include "support/filetools.h"
#include "support/Package.h"
#include "support/Path.h"
-using std::endl;
-using std::for_each;
-using std::string;
-using std::ostream;
-using std::vector;
+#include <ostream>
+
+using namespace std;
+using namespace lyx::support;
namespace lyx {
namespace external {
TemplateManager::TemplateManager()
{
- readTemplates(support::package().user_support());
+ readTemplates(package().user_support());
if (lyxerr.debugging(Debug::EXTERNAL)) {
dumpPreambleDefs(lyxerr);
lyxerr << '\n';
}
-class dumpPreambleDef {
+class DumpPreambleDef {
public:
typedef TemplateManager::PreambleDefs::value_type value_type;
- dumpPreambleDef(ostream & o) : ost(o) {}
+ DumpPreambleDef(ostream & o) : ost(o) {}
void operator()(value_type const & vt) {
ost << "PreambleDef " << vt.first << '\n'
};
-class dumpTemplate {
+class DumpTemplate {
public:
typedef TemplateManager::Templates::value_type value_type;
- dumpTemplate(ostream & o) : ost(o) {}
+ DumpTemplate(ostream & o) : ost(o) {}
void operator()(value_type const & vt) {
Template const & et = vt.second;
ostream & ost;
};
-class dumpFormat {
+class DumpFormat {
public:
typedef Template::Formats::value_type value_type;
- dumpFormat(ostream & o) : ost(o) {}
+ DumpFormat(ostream & o) : ost(o) {}
void operator()(value_type const & vt) const {
Template::Format const & ft = vt.second;
vector<string>::const_iterator qit = ft.requirements.begin();
vector<string>::const_iterator qend = ft.requirements.end();
for (; qit != qend; ++qit) {
- lyxerr << "req:" << *qit << std::endl;
+ lyxerr << "req:" << *qit << endl;
ost << "\t\tRequirement " << *qit << '\n';
}
void Template::dumpFormats(ostream & os) const
{
- for_each(formats.begin(), formats.end(), dumpFormat(os));
+ for_each(formats.begin(), formats.end(), DumpFormat(os));
}
void TemplateManager::dumpPreambleDefs(ostream & os) const
{
- for_each(preambledefs.begin(), preambledefs.end(), dumpPreambleDef(os));
+ for_each(preambledefs.begin(), preambledefs.end(), DumpPreambleDef(os));
}
void TemplateManager::dumpTemplates(ostream & os) const
{
- for_each(templates.begin(), templates.end(), dumpTemplate(os));
+ for_each(templates.begin(), templates.end(), DumpTemplate(os));
}
string const
TemplateManager::getPreambleDefByName(string const & name) const
{
- string const trimmed_name = support::trim(name);
+ string const trimmed_name = trim(name);
if (trimmed_name.empty())
return string();
}
-void TemplateManager::readTemplates(support::FileName const & path)
+void TemplateManager::readTemplates(FileName const & path)
{
- support::Path p(path);
+ PathChanger p(path);
enum TemplateTags {
TM_PREAMBLEDEF = 1,
Lexer lex(templatetags, TM_TEMPLATE_END);
- support::FileName const filename = support::libFileSearch("", "external_templates");
+ FileName const filename = libFileSearch("", "external_templates");
if (filename.empty() || !lex.setFile(filename)) {
lex.printError("external::TemplateManager::readTemplates: "
"No template file");
if (int(id) == -1) {
lyxerr << "external::Template::readTemplate\n"
<< "Transform " << name << " is not recognized"
- << std::endl;
+ << endl;
} else {
ids.push_back(id);
}
namespace {
-void transform_not_found(std::ostream & os, string const & transform)
+void transform_not_found(ostream & os, string const & transform)
{
os << "external::Format::readFormat. Transformation \""
- << transform << "\" is unrecognized." << std::endl;
+ << transform << "\" is unrecognized." << endl;
}
-void transform_class_not_found(std::ostream & os, string const & tclass)
+void transform_class_not_found(ostream & os, string const & tclass)
{
os << "external::Format::readFormat. Transformation class \""
- << tclass << "\" is unrecognized." << std::endl;
+ << tclass << "\" is unrecognized." << endl;
}