本文整理汇总了C++中CFileHandler::copyFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileHandler::copyFile方法的具体用法?C++ CFileHandler::copyFile怎么用?C++ CFileHandler::copyFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileHandler
的用法示例。
在下文中一共展示了CFileHandler::copyFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runAnalysis
void CChihlee::runAnalysis(const char *szInput, JSONObject &jsonResp)
{
CFileHandler file;
CString strWord = szInput;
CResponsePacket respPacket;
CString strText;
CString strSound;
CString strScreen;
strWord.replace("笑訊", "校訓");
strWord.replace("校去", "校訓");
strWord.replace("治理", "致理");
ofstream csWordFile("/chihlee/jetty/webapps/chihlee/Text.txt", ios::trunc);
strText.format("%s\n \n ", szInput);
csWordFile << strText.getBuffer() << endl;
csWordFile.close();
remove("/chihlee/jetty/webapps/chihlee/map.jpg");
//=============== 校園導覽 =================================//
if (0 <= strWord.find("導覽") || 0 <= strWord.find("地圖") || 0 <= strWord.find("參觀") || 0 <= strWord.find("校園"))
{
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_1.wav";
strScreen = "/chihlee/jetty/webapps/chihlee/img/map.jpg";
}
//=============== 廁所怎麼走 =================================//
if (0 <= strWord.find("廁所") || 0 <= strWord.find("洗手間") || 0 <= strWord.find("大便") || 0 <= strWord.find("小便")
|| 0 <= strWord.find("方便間"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/wc_map.jpg";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_2.wav";
}
//=============== 我想找電動輪椅充電 =================================//
if (0 <= strWord.find("電動輪椅") || 0 <= strWord.find("輪椅充電") || 0 <= strWord.find("充電") || 0 <= strWord.find("沒電"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/wc_map.jpg";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_3.wav";
}
//=============== 圖書館怎麼走 =================================//
if (0 <= strWord.find("圖書館") || 0 <= strWord.find("圖館") || 0 <= strWord.find("書館") || 0 <= strWord.find("看書"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/wc_map.jpg";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_4.wav";
}
//=============== 校訓 =================================//
if (0 <= strWord.find("校訓") || 0 <= strWord.find("誠信") || 0 <= strWord.find("致理科大"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/motto.png";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_5.wav";
}
//=============== 吉祥物 =================================//
if (0 <= strWord.find("吉祥物") || 0 <= strWord.find("喜鵲"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/character.jpg";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_6.wav";
}
//=============== 校歌 =================================//
if (0 <= strWord.find("校歌") || 0 <= strWord.find("學生活動"))
{
strScreen = "/chihlee/jetty/webapps/chihlee/img/song.jpg";
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_7.wav";
}
//================ 謝謝你的解說=====================//
if (0 <= strWord.find("謝謝") || 0 <= strWord.find("感謝") || 0 <= strWord.find("掰掰") || 0 <= strWord.find("拜拜")
|| 0 <= strWord.find("謝啦") || 0 <= strWord.find("謝拉"))
{
remove("/chihlee/jetty/webapps/chihlee/map.jpg");
strSound = "/chihlee/jetty/webapps/chihlee/wav/wav_8.wav";
}
file.copyFile(strScreen.getBuffer(), "/chihlee/jetty/webapps/chihlee/map.jpg");
playSound(strSound.getBuffer());
respPacket.setActivity<int>("type", RESP_TTS).setActivity<const char*>("lang", "zh").setActivity<const char*>("tts",
"").format(jsonResp);
}