Skip to content
Snippets Groups Projects
Commit 1fc43529 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Update string repr of WcclFile with imports section.

parent 8aa47d3a
Branches
No related merge requests found
......@@ -38,6 +38,12 @@ boost::shared_ptr<const TagRuleSequence> WcclFile::get_tag_rules_ptr() const
std::ostream& WcclFile::write_to(std::ostream& os) const
{
if (has_lexicons()) {
foreach(const Lexicons::map_t::value_type& v, lexicons_->get_lexicons()) {
os << "import(\"" << v.second->file_name() << ", \""
<< v.second->name() << "\")\n";
}
}
foreach(const boost::shared_ptr<FunctionalOpSequence>& s, all_sections_) {
os << s->to_string(tagset_) << '\n';
}
......
......@@ -77,6 +77,7 @@ public:
void import_lexicon(const boost::shared_ptr<Lexicon>& lexicon);
bool has_lexicon(const std::string& name) const;
bool has_lexicons() const;
boost::shared_ptr<const Lexicon> get_lexicon_ptr(const std::string& name) const;
const Lexicon& get_lexicon(const std::string& name) const;
boost::shared_ptr<const Lexicons> get_lexicons_ptr() const;
......@@ -307,6 +308,12 @@ bool WcclFile::has_lexicon(const std::string& name) const
return lexicons_->has_lexicon(name);
}
inline
bool WcclFile::has_lexicons() const
{
return lexicons_;
}
inline
boost::shared_ptr<const Lexicon> WcclFile::get_lexicon_ptr(const std::string& name) const
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment