Dictionary file manager The dictionary class loads entries from a file and then can perform operations on them. The dictionary class then stores the entries back into the file.

I would like to know the best way to check if the arguments to my dictionary member functions are valid terms/definitions.  I have thought of two possible solutions, but I am open to any other solutions.  I could either check the arguments passed in to the functions or make a term and definition class and and have the class check instead.

The reason why I want to distinguish strings from terms/definitions is so that I can read them from a file without having to encounter cases where definitions do not end in periods or other cases caused by human error.

dictionary.cpp

#include "dictionary.h"

//*** @TODO: What constitutes a term/definition ***

bool dictionary::search_term(const std::string&amp; term){
    for(auto&amp; it: entries){
        if(it.first != term);
        else return true;
    }return false;
};

bool dictionary::erase_entry(const std::string&amp; term){
    if(search_term(term)){
        entries.erase(term);
        return true;
    }else return false;
};

bool dictionary::define_term(const std::string&amp; term, const std::string&amp; definition){
    if(search_term(term)){
        entries[term] = definition;
        return true;
    }else return false;
};

bool dictionary::write_entry(const std::string&amp; term, const std::string&amp; definition){
if(!search_term(term)){
    entries[term] = definition;
        return true;
    }else return false;
};

inline bool exists (const std::string&amp; name) {
   struct stat buffer;   
   return (stat (name.c_str(), &amp;buffer) == 0); 
}

bool dictionary::ofs_entries(const std::string&amp; path){
    std::string file = (path + title);
    std::ofstream ofs(file.c_str());
    if(!ofs) return false;
    for(auto&amp; it: entries){
        ofs &lt;&lt; it.first &lt;&lt; ": " &lt;&lt; it.second &lt;&lt; '\n';
    }ofs.close();
};

bool dictionary::ifs_entries(const std::string&amp; path){
    std::string file = (path + title);
    if(!exists(file)) return false;
    std::ifstream ifs(file.c_str());
    if(!ifs) return false;
    std::string entry;
    while(true){
        //read entries
        if(!ifs.eof()) break;
    }return true;
};


dictionary.h

#ifndef DICTIONARY_H
#define DICTIONARY_H

#include &lt;algorithm&gt;
#include &lt;iterator&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;map&gt;

class dictionary{
   public:
        dictionary(const std::string&amp; title, const std::string&amp; definition = "")
            : entries{{title, definition}}, title(title){;};

        bool write_entry(const std::string&amp; term, const std::string&amp; definition = "");
        bool define_term(const std::string&amp; term, const std::string&amp; definition);

        bool erase_entry(const std::string&amp; term);
        bool search_term(const std::string&amp; term); 

        bool ofs_entries(const std::string&amp; path);
        bool ifs_entries(const std::string&amp; path);
    private:
        std::map&lt;std::string, std::string&gt; entries;
        std::string title;
};

#endif//DICTIONARY_H
Use the tools you have
The first thing I notice is that you're doing some work you don't need to. You're using a std::map to hold your keys and values, but you aren't utilizing the built-in method for finding an entry. (In other languages maps are actually named dictionary!) Your entire search_term() method could look like this:
bool dictionary::search_term(const std::string&amp; term){
    std::map&lt;std::string, std::string&gt;::iterator it = entries.find(term);
    return it != entries.end();
};

Likewise, the erase_entry() method could just call the std::map::erase() method.
Naming is hard
For the most part your variable and method names are pretty good! There are a few that I'd change, though. The exists() function should be something like file_exists() so it's not confused with checking if an entry exists in the dictionary.
Also, ofs_entries() and ifs_entries() are odd names. I'd call them something like write_entries_to_file() and read_entries_from_file().