XmlLingDefFormatter.h

Go to the documentation of this file.
00001 #ifndef _LINGUISTICDEFINITION_XMLLINGDEFFORMATTER_H_
00002 #define _LINGUISTICDEFINITION_XMLLINGDEFFORMATTER_H_
00003 
00004 #include <map>
00005 
00006 #include <libxml/tree.h>
00007 #include <libxml/xpath.h>
00008 #include <libxml/xmlwriter.h>
00009 
00010 #include "LingDef.h"
00011 #include "LingDefFormatter.h"
00012 
00013 namespace LinguisticDefinition {
00014 
00060   class XmlLingDefFormatter : public LingDefFormatter {
00061   public:
00062 
00066     XmlLingDefFormatter();
00067 
00073     LingDef createLingDef(const std::string &xmlData,
00074                           const std::string &isoLanguageCode = "");
00075 
00081     LingDef createLingDef(xmlDocPtr doc,
00082                           const std::string &isoLanguageCode = "");
00083 
00090     bool populateLingDef(const std::string &xmlData, LingDef &lingDef);
00091 
00098     bool populateLingDef(xmlDocPtr doc, LingDef &lingDef);
00099 
00103     std::string output(const LingDef &) const;
00104 
00108     void output(const LingDef &, std::ostream &) const;
00109 
00110   private:
00111 
00115     bool langOk(const std::string &, const std::string &) const;
00116 
00120     bool langOk(xmlNodePtr, const LingDef &) const;
00121 
00125     bool addLingDef(xmlNodePtr, LingDef &);
00126 
00130     LingDef::Pos *addPos(xmlNodePtr, LingDef &, LingDef::Pos *parentPos);
00131 
00135     LingDef::Feature::Domain getFeatureDomain(xmlNodePtr featureNode);
00136 
00140     LingDef::Feature::Type getFeatureType(xmlNodePtr featureNode);
00141 
00145     bool addFeature(xmlNodePtr, LingDef::Pos &);
00146 
00150     bool addFeature(xmlNodePtr, LingDef::Feature &);
00151 
00155     bool addTree(xmlNodePtr, LingDef &);
00156 
00160     bool addTreeNode(xmlNodePtr, LingDef &, LingDef::Tree::Node &);
00161 
00165     void getPosIds(xmlNodePtr posNode,
00166                    std::string &id,
00167                    std::string &inheritsId);
00168 
00169 
00170   private:
00171   };
00172 
00173 }
00174 
00175 #endif //_LINGUISTICDEFINITION_XMLLINGDEFFORMATTER_H_

Generated on Fri Jun 23 14:03:15 2006 for LinguisticDefinition by  doxygen 1.4.7