diff --git a/compile_and_install_ubuntu.sh b/compile_and_install_ubuntu.sh index 18c4e8f..4eb23ef 100755 --- a/compile_and_install_ubuntu.sh +++ b/compile_and_install_ubuntu.sh @@ -9,3 +9,4 @@ if [ ! -f "$INST_FILE" ] then $INST_CMD fi +rm dictcc diff --git a/dict/dict_imp.cc b/dict/dict_imp.cc index e014031..bedd4ac 100644 --- a/dict/dict_imp.cc +++ b/dict/dict_imp.cc @@ -85,7 +85,7 @@ namespace dictcc return d_translations; } - void dict::reset_search(void) + search_ptr_t dict::reset_search(void) { // Initialize the word lists so they are not empty. str_list_t l0(1, ""), l1(1, ""); @@ -97,6 +97,12 @@ namespace dictcc // Apparently, the pointer has not been initialized yet. d_translations = std::make_shared(pair); } + return d_translations; + } + + search_ptr_t dict::get_translations(void) + { + return d_translations; } std::string dict::langs2str(const lang_t& lt) diff --git a/dict/dict_int.h b/dict/dict_int.h index 7a2bc77..b81682e 100644 --- a/dict/dict_int.h +++ b/dict/dict_int.h @@ -58,12 +58,15 @@ namespace dictcc virtual ~dict(){} public: - /*! \brief Perform a search and create a smart pointer object. + /*! \brief Perform a search and return results. */ search_ptr_t search(std::string word); /*! \brief Make sure there are two empty word lists. */ - void reset_search(void); + search_ptr_t reset_search(void); + /*! Simply returns a pointer to the translations, no matter if the smart pointer actually holds any data. + */ + search_ptr_t get_translations(void); static std::string langs2str(const lang_t& lt); static lang_t str2langs(const std::string& str); /*! \brief Help function: Get the size of a string in chars containing multibyte characters e.g. ΓΌ.