X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FTDictionary.hh;h=4864630f969cf0c36bb117a7a5855300aead6de2;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=f3ad19dc144bc481ef51271d30c1808752edd76f;hpb=c112706f347e08e7f345131fbc4c3aa0e9ecc7b5;p=helm.git diff --git a/helm/DEVEL/mathml_editor/src/TDictionary.hh b/helm/DEVEL/mathml_editor/src/TDictionary.hh index f3ad19dc1..4864630f9 100644 --- a/helm/DEVEL/mathml_editor/src/TDictionary.hh +++ b/helm/DEVEL/mathml_editor/src/TDictionary.hh @@ -30,7 +30,14 @@ #include #include +#if defined(HAVE_EXT_HASH_MAP) +#include +#elif defined(HAVE_HASH_MAP) #include +#else +#error "no hash_map could be found" +#endif +#include #include "dom.hh" #include "TToken.hh" @@ -83,14 +90,24 @@ public: unsigned table : 1; }; + static std::string getDefaultDictionaryPath(void); + void load(const std::string&); void load(const std::string&, const std::string&); void load(const DOM::Document&, const std::string& = ""); const Entry& find(const std::string&) const; + std::string complete(const std::string, std::list&) const; private: +#if defined(HAVE_EXT_HASH_MAP) + struct StringHash : public std::unary_function< std::string, size_t > + { size_t operator()(const std::string& s) const { return __gnu_cxx::hash()(s.c_str()); } }; +#elif defined(HAVE_HASH_MAP) struct StringHash : public std::unary_function< std::string, size_t > { size_t operator()(const std::string& s) const { return hash()(s.c_str()); } }; +#else +#error "no hash_map could be found" +#endif #if 0 struct StringEq : public std::binary_function< std::string, std::string, bool >