Unoffical C++ API for dict.cc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
738 B

#ifndef DICTCC_CREATOR_INCLUDED
#define DICTCC_CREATOR_INCLUDED
// Dictcc API
#include "dict_int.h"
#include "desv.h"
#include "deen.h"
#include "types.h"
#include "exceptions.h"
namespace dictcc
{
class creator
{
private:
creator(){}
~creator(){}
public:
static std::shared_ptr<dict> create(const std::string langs)
{
lang_t l = dict::str2langs(langs);
// TODO: Add new languages here
switch (l) {
case DESV:
return std::make_shared<desv>();
case DEEN:
return std::make_shared<deen>();
default:
throw(dict_lang_error(__FILE__, __LINE__));
}
}
};
} // namespace dictcc
#endif // DICTCC_DESV_INCLUDED