|
@@ -57,6 +57,18 @@ void DivideEquallyStr(const char *buff, int len, char left[], char right[])
|
|
{
|
|
{
|
|
std::string strtemp = buff;
|
|
std::string strtemp = buff;
|
|
std::size_t keyindex1 = std::string::npos, keyindex2 = std::string::npos, keyindex;
|
|
std::size_t keyindex1 = std::string::npos, keyindex2 = std::string::npos, keyindex;
|
|
|
|
+ int i = 0;
|
|
|
|
+ for (i = 0; i < len / 2; i++)
|
|
|
|
+ {
|
|
|
|
+ if (!(buff[i] < 0x80 && buff[i] >= 0x0))
|
|
|
|
+ {
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ strncpy(left, buff, i);
|
|
|
|
+ strncpy(right, buff + i, len - i);
|
|
|
|
+ return;
|
|
|
|
+ /* 直接中间分开,不用特殊处理*/
|
|
std::string strKey1 = ";", strKey2 = " ";
|
|
std::string strKey1 = ";", strKey2 = " ";
|
|
std::size_t found = strtemp.find(strKey1);
|
|
std::size_t found = strtemp.find(strKey1);
|
|
bool flag1 = false, flag2 = false;
|
|
bool flag1 = false, flag2 = false;
|
|
@@ -186,8 +198,18 @@ int AssignWordsFromTest(std::string pathName, std::vector<std::string> &twoList,
|
|
CString filepath = csFullPath.Left(nPos);
|
|
CString filepath = csFullPath.Left(nPos);
|
|
CString FilePath1 = filepath + L"\\config.ini";
|
|
CString FilePath1 = filepath + L"\\config.ini";
|
|
CString FilePath2 = filepath + L"\\words.txt";
|
|
CString FilePath2 = filepath + L"\\words.txt";
|
|
- WCHAR wflagWord[10];
|
|
|
|
|
|
+ WCHAR wflagWord[10],wFourColScaleParam[10],wThreeColScaleParam[10],wTwoColScaleParam[10];
|
|
GetPrivateProfileString(L"USER", L"flagWord", L"1", wflagWord, 10, FilePath1);
|
|
GetPrivateProfileString(L"USER", L"flagWord", L"1", wflagWord, 10, FilePath1);
|
|
|
|
+ GetPrivateProfileString(L"USER", L"TwoColScaleParam", L"6", wTwoColScaleParam, 10, FilePath1);
|
|
|
|
+ GetPrivateProfileString(L"USER", L"ThreeColScaleParam", L"9", wThreeColScaleParam, 10, FilePath1);
|
|
|
|
+ GetPrivateProfileString(L"USER", L"FourColScaleParam", L"16", wFourColScaleParam, 10, FilePath1);
|
|
|
|
+ int nFourColScaleParam = 0, nThreeColScaleParam = 0, nTwoColScaleParam = 0;
|
|
|
|
+ nFourColScaleParam = _wtoi(wFourColScaleParam);
|
|
|
|
+ nFourColScaleParam = nFourColScaleParam > 0 ? nFourColScaleParam : 16;
|
|
|
|
+ nThreeColScaleParam = _wtoi(wThreeColScaleParam);
|
|
|
|
+ nThreeColScaleParam = nThreeColScaleParam > 0 ? nThreeColScaleParam : 9;
|
|
|
|
+ nTwoColScaleParam = _wtoi(wTwoColScaleParam);
|
|
|
|
+ nTwoColScaleParam = nTwoColScaleParam > 0 ? nTwoColScaleParam : 6;
|
|
CString lpszflagWord(wflagWord);
|
|
CString lpszflagWord(wflagWord);
|
|
std::vector<std::string> WordList;
|
|
std::vector<std::string> WordList;
|
|
WordList.push_back("vt.");
|
|
WordList.push_back("vt.");
|
|
@@ -234,9 +256,9 @@ int AssignWordsFromTest(std::string pathName, std::vector<std::string> &twoList,
|
|
int cout = 0;
|
|
int cout = 0;
|
|
if (_access(pathName.c_str(), 00) != -1)
|
|
if (_access(pathName.c_str(), 00) != -1)
|
|
{
|
|
{
|
|
- int maxTwoWith = main_wdith / 4 - chk_width;
|
|
|
|
- int maxTreeWith = main_wdith*2/9 - chk_width;
|
|
|
|
- int maxFourWith = main_wdith * 3 / 16 - chk_width;
|
|
|
|
|
|
+ int maxTwoWith = main_wdith / 2 - main_wdith / nTwoColScaleParam - chk_width;
|
|
|
|
+ int maxTreeWith = main_wdith / 3 - main_wdith / nThreeColScaleParam - chk_width;
|
|
|
|
+ int maxFourWith = main_wdith / 4 - main_wdith/ nFourColScaleParam - chk_width;
|
|
std::ifstream fin(pathName.c_str(), std::ios::in);
|
|
std::ifstream fin(pathName.c_str(), std::ios::in);
|
|
char line[4096] = { 0 };
|
|
char line[4096] = { 0 };
|
|
while (fin.getline(line, sizeof(line)))
|
|
while (fin.getline(line, sizeof(line)))
|