Ejemplo n.º 1
0
void RecipeManager::GetRecipeList(std::list<std::string>& recipe_list)
{
	fs::path recipe_path("./recipe");
	if(!fs::exists(recipe_path) || !fs::is_directory(recipe_path))
		return;

	fs::directory_iterator dir_itor(recipe_path), end_itor;
	while(dir_itor != end_itor)
	{
		if(fs::is_regular_file(dir_itor->path()) && (dir_itor->path().extension() == L".rcp"))
		{
			std::wstring wfilename = dir_itor->path().filename().native();
			wfilename = wfilename.substr(0, wfilename.size()-4);
			recipe_list.push_back(wstring_to_utf8(wfilename));
		}
		++dir_itor;
	}
}
Ejemplo n.º 2
0
PcRe::PcRe (const std::wstring &regex)
{
    const char *err;
	int erroffset;
	re = pcre_compile2 (wstring_to_utf8 (regex).c_str (),
#ifdef PCRE_UTF8
			PCRE_UTF8|
#endif
#ifdef PCRE_NO_UTF8_CHECK
			PCRE_NO_UTF8_CHECK|
#endif
			PCRE_MULTILINE|PCRE_CASELESS,
			0, &err, &erroffset, 0);
	if (re) {
		re_ex = pcre_study ((const pcre *)re, 0, &err);
	}
	else {
		re_ex = 0;
	}
}
Ejemplo n.º 3
0
std::string moon::string_to_utf8(const std::string& src)
{
	return wstring_to_utf8(string_to_wstring(src));
}