I have to make a project for school. The objective is simple, It should have something to do with file handling.
I don't want to do something as simple as database management. On the other hand, we are not permitted to do anything involving export of foreign elements like graphics or fonts, etc.
Any ideas on how I can have fun with this thing? Some good project ideas?
class MessageManager
{
public:
/**
* Set the object to the message file
*/
void load(const std::string& file_name);
/**
* Set the required language to use
*/
void set_language(const std::string& lang);
/**
* Retrieve a single message identified by key in the
* language configured by calling set_language()
*/
std::string get_message(const std::string& key);
/**
* Return a list of languages available in the
* current message store, configured using
* load().
*/
std::vector<std::string> get_languages();
};
MessageManager mm;
int main()
{
mm.load("program_messages.txt");
mm.set_language("en"); // code for English
std::cout << mm.get_message("welcome") << '\n'; // Program startup message
}
program_messages.txt
en:welcome:Welcome to ProgName
fr:welcome:Bienvenu a ProgName
sp:welcome:Bienvenido a ProgName
Well, if you think that database managment is simple I have something a little more complex (but not too complicated) in mind.
Take a file that contains a mish mash of contact information for a bunch of people, maybe even copy and paste the text from your schools contact page on their website, and sort through which entry is a name, phone number (typed in any format) or E mail address (Hint: Look for '@' as a deliminating character). Then sort each bit of data into it's own file, but do so that when a person goes to retrieve a name or phone number from the program it all comes back correctly.
Honestly I'm not sure I can type out what my idea is in a coherant matter at the moment and Galik gave you an A idea if you can pull it off. I just thought if your were looking for more input I'd throw that out there.