diff --git a/ConsoleApplication3.exe b/ConsoleApplication3.exe deleted file mode 100644 index c17e73f..0000000 Binary files a/ConsoleApplication3.exe and /dev/null differ diff --git a/ConsoleApplication3.sln b/ConsoleApplication3.sln deleted file mode 100644 index 46183a0..0000000 --- a/ConsoleApplication3.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication3", "ConsoleApplication3\ConsoleApplication3.vcxproj", "{9003FC25-A6B5-451B-BDAE-B764FDAB37E1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Debug|x64.ActiveCfg = Debug|x64 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Debug|x64.Build.0 = Debug|x64 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Debug|x86.ActiveCfg = Debug|Win32 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Debug|x86.Build.0 = Debug|Win32 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Release|x64.ActiveCfg = Release|x64 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Release|x64.Build.0 = Release|x64 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Release|x86.ActiveCfg = Release|Win32 - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/ConsoleApplication3/ConsoleApplication3.cpp b/ConsoleApplication3/ConsoleApplication3.cpp deleted file mode 100644 index 59aff27..0000000 --- a/ConsoleApplication3/ConsoleApplication3.cpp +++ /dev/null @@ -1,958 +0,0 @@ -#include "stdafx.h" - -errno_t subUTF8(const wchar_t *source, wchar_t *baseFileName); -errno_t subUTF8B(const wchar_t *source, wchar_t *baseFileName); - -errno_t loadTextFromBinary(const wchar_t *source, char **to) { - - errno_t success = 0; - errno_t readFileError = 0; - FILE *fp; - int error = 0; - struct _stat statData; - int readSize = 0; - - if (source == NULL) { - success = 1; - goto F; - } - - /* */ - error = _wstat(source, &statData); - if (error != NULL) { - success = 2; - goto F; - } - - /* */ - - readFileError = _wfopen_s(&fp, source, L"rb"); - if (readFileError != NULL) { - success = 3; - goto F; - } - - /* */ - *to = (char*)calloc(statData.st_size + 1, sizeof(char)); - if (*to == NULL) { - success = 4; - goto A; - } - - /* */ - readSize = fread_s(*to, statData.st_size, sizeof(char), statData.st_size, fp); - - if (readSize != statData.st_size) { - success = 5; - goto A; - } - -A: - fclose(fp); -F: - return success; -} - -errno_t removeBOM(const char *from, char **to) { - - errno_t success = 0; - errno_t err = 0; - unsigned int size = 0; - - /* */ - if (from == NULL) { - success = 1; - goto A; - } - - /* */ - if (strlen(from) < 4) { - success = 2; - goto A; - } - - /* */ - if (!((from[0] == ((char)0xEF)) && (from[1] == (char)0xBB) && (from[2] == (char)0xBF))) { - success = 3; - goto A; - } - - /* */ - size = strlen(from); - - /* */ - *to = (char*)calloc(size - 2, sizeof(char)); - - if (*to == NULL) { - success = 4; - goto A; - } - - /* */ - err = memcpy_s(*to, size - 2, from + 3, size - 3); - - if (err) { - success = 5; - goto B; - } - - goto A; - -B: - free(*to); - -A: - return success; -} - -errno_t convertTextToWideText(const char* from, wchar_t **to) { - - errno_t success = 0; - unsigned int err = 0; - unsigned int wideTextSize = 0; - - /* */ - if (from == NULL) { - success = 1; - goto A; - } - - /* */ - wideTextSize = MultiByteToWideChar( - CP_UTF8, - NULL, - from, - -1, - NULL, - NULL); - - if (wideTextSize == NULL) { - success = GetLastError(); - goto A; - } - - /* */ - *to = (wchar_t*)calloc(wideTextSize, sizeof(wchar_t)); - - if (*to == NULL) { - success = 3; - goto A; - } - - /* */ - err = MultiByteToWideChar( - CP_UTF8, - NULL, - from, - -1, - *to, - wideTextSize); - - if (err == NULL) { - success = 4; - goto B; - } - - goto A; - -B: - free(*to); -A: - return success; -} - -inline wchar_t UCS2ToCP1252(int cp) { - wchar_t result = cp; - switch (cp) { - case 0x20AC: result = 0x80; break; - case 0x201A: result = 0x82; break; - case 0x0192: result = 0x83; break; - case 0x201E: result = 0x84; break; - case 0x2026: result = 0x85; break; - case 0x2020: result = 0x86; break; - case 0x2021: result = 0x87; break; - case 0x02C6: result = 0x88; break; - case 0x2030: result = 0x89; break; - case 0x0160: result = 0x8A; break; - case 0x2039: result = 0x8B; break; - case 0x0152: result = 0x8C; break; - case 0x017D: result = 0x8E; break; - case 0x2018: result = 0x91; break; - case 0x2019: result = 0x92; break; - case 0x201C: result = 0x93; break; - case 0x201D: result = 0x94; break; - case 0x2022: result = 0x95; break; - case 0x2013: result = 0x96; break; - case 0x2014: result = 0x97; break; - case 0x02DC: result = 0x98; break; - case 0x2122: result = 0x99; break; - case 0x0161: result = 0x9A; break; - case 0x203A: result = 0x9B; break; - case 0x0153: result = 0x9C; break; - case 0x017E: result = 0x9E; break; - case 0x0178: result = 0x9F; break; - } - - return result; -} - -inline wchar_t cp1252ToUCS2(byte cp) { - wchar_t result = cp; - switch (cp) { - case 0x80: result = 0x20AC; break; - case 0x82: result = 0x201A; break; - case 0x83: result = 0x0192; break; - case 0x84: result = 0x201E; break; - case 0x85: result = 0x2026; break; - case 0x86: result = 0x2020; break; - case 0x87: result = 0x2021; break; - case 0x88: result = 0x02C6; break; - case 0x89: result = 0x2030; break; - case 0x8A: result = 0x0160; break; - case 0x8B: result = 0x2039; break; - case 0x8C: result = 0x0152; break; - case 0x8E: result = 0x017D; break; - case 0x91: result = 0x2018; break; - case 0x92: result = 0x2019; break; - case 0x93: result = 0x201C; break; - case 0x94: result = 0x201D; break; - case 0x95: result = 0x2022; break; - case 0x96: result = 0x2013; break; - case 0x97: result = 0x2014; break; - case 0x98: result = 0x02DC; break; - case 0x99: result = 0x2122; break; - case 0x9A: result = 0x0161; break; - case 0x9B: result = 0x203A; break; - case 0x9C: result = 0x0153; break; - case 0x9E: result = 0x017E; break; - case 0x9F: result = 0x0178; break; - } - - return result; - -} - -errno_t convertWideTextToEscapedWideText(const wchar_t* from, wchar_t** to) { - - errno_t success = 0; - int toIndex = 0; - unsigned int size = 0; - - /* */ - if (from == NULL) { - success = 1; - goto A; - } - - /* */ - size = wcslen(from); - - /* ‘S•”ƒGƒXƒP[ƒv‚µ‚Ä‚à‚R”{‚ð’´‚¦‚邱‚Æ‚Í‚È‚¢B‚P‚O‚̓oƒbƒtƒ@*/ - *to = (wchar_t*)calloc(size * 3 + 10, sizeof(wchar_t)); - - if (*to == NULL) { - success = 2; - goto A; - } - - /* */ - toIndex = 0; - for (unsigned int fromIndex = 0; fromIndex < size; fromIndex++) { - wchar_t cp = from[fromIndex]; - - /* */ - if (UCS2ToCP1252(cp) != cp) { - (*to)[toIndex++] = cp; - continue; - } - - /* ‚¸‚ç‚· */ - if (cp > 0x100 && cp < 0xA00) { - cp = cp + 0xE000; - } - - /* ãˆÊƒoƒCƒg */ - byte high = (cp >> 8) & 0x000000FF; - - /* ‰ºˆÊƒoƒCƒg */ - byte low = cp & 0x000000FF; - - byte escapeChr = 0x10; - - /* 2byte‚¶‚á‚È‚¢ */ - if (high == 0) { - (*to)[toIndex++] = cp; - continue; - } - - /* high byte‚æ‚茈’è */ - switch (high) { - case 0xA4:case 0xA3:case 0xA7:case 0x24:case 0x5B:case 0x00:case 0x5C: - case 0x20:case 0x0D:case 0x0A:case 0x22:case 0x7B:case 0x7D:case 0x40: - case 0x80:case 0x7E:case 0x2F:case 0xBD:case 0x3B:case 0x5D:case 0x5F: - case 0x3D:case 0x23: - escapeChr += 2; - break; - default: - break; - } - - /* low byte‚æ‚茈’è */ - switch (low) { - case 0xA4:case 0xA3:case 0xA7:case 0x24:case 0x5B:case 0x00:case 0x5C: - case 0x20:case 0x0D:case 0x0A:case 0x22:case 0x7B:case 0x7D:case 0x40: - case 0x80:case 0x7E:case 0x2F:case 0xBD:case 0x3B:case 0x5D:case 0x5F: - case 0x3D:case 0x23: - escapeChr++; - break; - default: - break; - } - - switch (escapeChr) { - case 0x11: - low += 14; - break; - case 0x12: - high -= 9; - break; - case 0x13: - low += 14; - high -= 9; - break; - case 0x10: - default: - break; - } - - (*to)[toIndex++] = escapeChr; - (*to)[toIndex++] = cp1252ToUCS2(low); - (*to)[toIndex++] = cp1252ToUCS2(high); - } - -A: - return success; -} - -errno_t convertWideTextToText(const wchar_t* from, char **to) { - - errno_t success = 0; - int size = 0; - int err = 0; - - /* */ - if (from == NULL) { - success = 1; - goto A; - } - - /* */ - size = WideCharToMultiByte( - CP_UTF8, - 0, - from, - -1, - NULL, - 0, - NULL, - NULL - ); - - if (size == NULL) { - success = 2; - goto A; - } - - /* */ - *to = (char*)malloc(size * sizeof(char)); - if (*to == NULL) { - success = 3; - goto A; - } - - /* */ - err = WideCharToMultiByte( - CP_UTF8, - 0, - from, - -1, - *to, - size, - NULL, - NULL - ); - - if (err == NULL) { - success = 4; - goto B; - } - - goto A; - -B: - free(*to); - -A: - return success; -} - -errno_t attachWildCard(const wchar_t* from, wchar_t ** to) { - - errno_t error = 0; - unsigned int size = 0; - errno_t err = 0; - - /* */ - if (from == NULL) { - error = 1; - goto A; - } - - /* */ - size = wcslen(from); - - /* */ - *to = (wchar_t*)calloc(size + 3, sizeof(wchar_t)); - - if (*to == NULL) { - error = 2; - goto A; - } - - /* */ - err = wmemcpy_s(*to, size, from, size); - if (err) { - error = 3; - goto B; - } - - /* */ - (*to)[size] = L'\\'; - (*to)[size + 1] = L'*'; - - /* */ - goto A; - -B: - free(*to); - -A: - return error; -} - -errno_t attachBOM(const char* from, char ** to) { - - errno_t error = 0; - unsigned int size = 0; - - /* */ - if (from == NULL) { - error = 1; - goto A; - } - - /* */ - size = strlen(from); - - /* */ - *to = (char*)calloc(size + 4, sizeof(char)); - if (*to == NULL) { - error = 2; - goto A; - } - - /* UTF-8 BOM */ - (*to)[0] = (char)0xEF; - (*to)[1] = (char)0xBB; - (*to)[2] = (char)0xBF; - - /* */ - if (memcpy_s(*to + 3, size + 4, from, size)) { - error = 3; - goto B; - } - - /* */ - goto A; - -B: - free(*to); - -A: - return error; -} - -/* Cpp code */ -const std::wregex FILE_NAME_PATTERN1(L"^(.+)\.utf8b(\.[a-zA-Z0-9]+)$"); -const std::wregex FILE_NAME_PATTERN2(L"^(.+)\.(\.[a-zA-Z0-9_]+).utf8$"); -inline errno_t getBaseFileName(const wchar_t *source, wchar_t **to, const std::wregex pattern) { - - errno_t error = 0; - std::wcmatch match; - - /* */ - try { - if (!std::regex_match(source, match, pattern)) { - /* Not match */ - *to = NULL; - goto A; - } - - /* */ - unsigned int size = wcslen(source); - - /* */ - *to = (wchar_t*)calloc(size, sizeof(wchar_t)); - if (*to == NULL) { - error = 1; - goto A; - } - - /* */ - std::wstring tmp = match.str(1); /* + match.str( */ - wcscat_s(*to, tmp.length() + 1, tmp.c_str()); - } - catch (std::regex_error& e) { - error = 1; - } - -A: - return error; -} - -errno_t getFullPath(wchar_t *from[], wchar_t **to) { - - errno_t error = 0; - wchar_t *err = NULL; - - /* */ - if (!(*++from)) { - error = 1; - goto F; - } - - /* */ - *to = (wchar_t*)calloc(_MAX_PATH, sizeof(wchar_t)); - if (*to == NULL) { - error = 2; - goto F; - } - - /* */ - err = _wfullpath(*to, *from, _MAX_PATH); - if (*err == NULL) { - error = 3; - goto A; - } - - /* */ - goto F; - -A: - free(*to); - -F: - return error; -} - -/* http://www14.big.or.jp/~ken1/tech/tech5.html */ -errno_t digDir(const wchar_t *source) -{ - errno_t success = 0; - wchar_t subpath[_MAX_PATH]; - wchar_t temp[_MAX_PATH]; - HANDLE h; - WIN32_FIND_DATA lp; - - /* */ - errno_t err = wcscpy_s(temp, source); - if (err > 0) { - success = 1; - goto A; - } - - /* */ - h = FindFirstFile(temp, &lp); - if (INVALID_HANDLE_VALUE == h) { - success = 2; - goto A; - } - - /* delete last '*' */ - temp[wcslen(temp) - 1] = '\0'; - - /* */ - do - { - /* isDir */ - if ((lp.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - (wcscmp(lp.cFileName, L"..") != 0) && - (wcscmp(lp.cFileName, L".") != 0) - ) { - /* TODO:check len */ - int len = wsprintf(subpath, L"%s%s\\*", temp, lp.cFileName); - - /* */ - errno_t err2 = digDir(subpath); - if (err2 > 0) { - success = 3; - goto B; - } - } - - /* isFile */ - if ((lp.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { - /* */ - wchar_t *baseFileName; - errno_t err3 = getBaseFileName(lp.cFileName, &baseFileName,FILE_NAME_PATTERN1); - if (err3 > 0) { - success = 4; - goto B; - } - - /* */ - if (baseFileName != NULL) { - /* TODO:check len */ - wchar_t fileFullPath[_MAX_PATH]; - int len = wsprintf(fileFullPath, L"%s%s", temp, lp.cFileName); - - /* */ - errno_t errSub = subUTF8B(fileFullPath, baseFileName); - - free(baseFileName); - - if (errSub > 0) { - goto B; - } - } - else { - errno_t err4 = getBaseFileName(lp.cFileName, &baseFileName, FILE_NAME_PATTERN2); - if (err4 > 0) { - success = 4; - goto B; - } - if (baseFileName != NULL) { - /* TODO:check len */ - wchar_t fileFullPath[_MAX_PATH]; - int len = wsprintf(fileFullPath, L"%s%s", temp, lp.cFileName); - - /* */ - errno_t errSub = subUTF8(fileFullPath, baseFileName); - - free(baseFileName); - - if (errSub > 0) { - goto B; - } - } - } - } - } while (FindNextFile(h, &lp)); - -B: - FindClose(h); - -A: - return success; -} - -/**/ -int wmain(int argc, wchar_t *argv[], wchar_t *envp[]) -{ - errno_t error = 0; - wchar_t *fullPath = NULL; - wchar_t *attachWildCardFullPath = NULL; - - /* */ - error = getFullPath(argv, &fullPath); - if (error > 0) { - printf("ˆø”ˆÙí:%d", error); - goto A; - } - - /* */ - error = attachWildCard(fullPath, &attachWildCardFullPath); - if (error > 0) { - printf("ƒƒCƒ‹ƒhƒJ[ƒh“Y•tˆÙí:%d", error); - goto B; - } - - /* */ - error = digDir(attachWildCardFullPath); - if (error > 0) { - printf("ƒfƒBƒŒƒNƒgƒŠŒŸoˆÙí:%d", error); - goto C; - } - -C: - free(attachWildCardFullPath); - -B: - free(fullPath); - -A: - return 0; -} - -errno_t saveTextToBinary2(const wchar_t *source, const wchar_t *baseFileName, const char* from) { - - errno_t success = 0; - int file_size = 0; - errno_t fopen_err = 0; - - if (source == NULL) { - success = 1; - goto F; - } - - wchar_t drive[_MAX_DRIVE]; - wchar_t dir[_MAX_DIR]; - wchar_t fname[_MAX_FNAME]; - wchar_t ext[_MAX_EXT]; - - /* */ - _wsplitpath_s( - source, - drive, - dir, - fname, - ext - ); - - /* */ - wchar_t exportPath[_MAX_EXT]; - _wmakepath_s(exportPath, drive, dir, fname, L""); - - /* */ - FILE *fw; - fopen_err = _wfopen_s(&fw, exportPath, L"wb"); - - if (fopen_err) { - success = 3; - goto F; - } - - /* */ - file_size = fwrite(from, sizeof(char), strlen(from), fw); - - if (file_size != strlen(from)) { - success = 4; - goto A; - } - -A: - fclose(fw); -F: - return success; -} - -errno_t saveTextToBinary(const wchar_t *source, const wchar_t *baseFileName, const char* from) { - - errno_t success = 0; - int file_size = 0; - errno_t fopen_err = 0; - - if (source == NULL) { - success = 1; - goto F; - } - - wchar_t drive[_MAX_DRIVE]; - wchar_t dir[_MAX_DIR]; - wchar_t fname[_MAX_FNAME]; - wchar_t ext[_MAX_EXT]; - - /* */ - _wsplitpath_s( - source, - drive, - dir, - fname, - ext - ); - - /* */ - wchar_t exportPath[_MAX_EXT]; - _wmakepath_s(exportPath, drive, dir, baseFileName, ext); - - /* */ - FILE *fw; - fopen_err = _wfopen_s(&fw, exportPath, L"wb"); - - if (fopen_err) { - success = 3; - goto F; - } - - /* */ - file_size = fwrite(from, sizeof(char), strlen(from), fw); - - if (file_size != strlen(from)) { - success = 4; - goto A; - } - -A: - fclose(fw); -F: - return success; -} - - -/* */ -errno_t subUTF8(const wchar_t *source, wchar_t *baseFileName) { - errno_t ans = 0; - - char *importText = NULL; - char *noBOMtext = NULL; - wchar_t *wideNoBOMtext = NULL; - wchar_t *escapedNoBOMWideText = NULL; - char *escapedNoBOMText = NULL; - char* escapedText = NULL; - - /* */ - ans = loadTextFromBinary(source, &importText); - if (ans > 0) { - printf("ƒtƒ@ƒCƒ‹‚©‚çƒeƒLƒXƒg‚ð“Ç‚Ýž‚ß‚È‚¢:%d", ans); - goto A; - } - - /* */ - ans = convertTextToWideText(importText, &wideNoBOMtext); - if (ans > 0) { - printf("M->W‚ª•ÏŠ·‚Å‚«‚È‚©‚Á‚½:%d", ans); - goto C; - } - - /* */ - ans = convertWideTextToEscapedWideText(wideNoBOMtext, &escapedNoBOMWideText); - if (ans > 0) { - printf("ƒGƒXƒP[ƒv‚ÉŽ¸”s‚µ‚½:%d", ans); - goto D; - } - - /* */ - ans = convertWideTextToText(escapedNoBOMWideText, &escapedNoBOMText); - if (ans > 0) { - printf("W->M‚ª•ÏŠ·‚Å‚«‚È‚©‚Á‚½:%d", ans); - goto E; - } - - /* */ - ans = attachBOM(escapedNoBOMText, &escapedText); - if (ans > 0) { - printf("BOM‚ð‚‚¯‚é‚Ì‚ÉŽ¸”s:%d", ans); - goto F; - } - - /* */ - ans = saveTextToBinary2(source, baseFileName, escapedText); - if (ans > 0) { - printf("ƒtƒ@ƒCƒ‹‚ðƒZ[ƒu‚·‚é‚Ì‚ÉŽ¸”s:%d", ans); - } - -G: - free(escapedText); - -F: - free(escapedNoBOMText); - -E: - free(escapedNoBOMWideText); - -D: - free(wideNoBOMtext); - -C: - free(noBOMtext); - -B: - free(importText); - -A: - return ans; -} - - -/* */ -errno_t subUTF8B(const wchar_t *source, wchar_t *baseFileName) { - errno_t ans = 0; - - char *importText = NULL; - char *noBOMtext = NULL; - wchar_t *wideNoBOMtext = NULL; - wchar_t *escapedNoBOMWideText = NULL; - char *escapedNoBOMText = NULL; - char* escapedText = NULL; - - /* */ - ans = loadTextFromBinary(source, &importText); - if (ans > 0) { - printf("ƒtƒ@ƒCƒ‹‚©‚çƒeƒLƒXƒg‚ð“Ç‚Ýž‚ß‚È‚¢:%d", ans); - goto A; - } - - /* */ - ans = removeBOM(importText, &noBOMtext); - if (ans > 0) { - printf("BOM‚ª‚‚¢‚Ä‚¢‚È‚¢‚©‚çUTF-8‚¶‚á‚È‚¢:%d", ans); - goto B; - } - - /* */ - ans = convertTextToWideText(noBOMtext, &wideNoBOMtext); - if (ans > 0) { - printf("M->W‚ª•ÏŠ·‚Å‚«‚È‚©‚Á‚½:%d", ans); - goto C; - } - - /* */ - ans = convertWideTextToEscapedWideText(wideNoBOMtext, &escapedNoBOMWideText); - if (ans > 0) { - printf("ƒGƒXƒP[ƒv‚ÉŽ¸”s‚µ‚½:%d", ans); - goto D; - } - - /* */ - ans = convertWideTextToText(escapedNoBOMWideText, &escapedNoBOMText); - if (ans > 0) { - printf("W->M‚ª•ÏŠ·‚Å‚«‚È‚©‚Á‚½:%d", ans); - goto E; - } - - /* */ - ans = attachBOM(escapedNoBOMText, &escapedText); - if (ans > 0) { - printf("BOM‚ð‚‚¯‚é‚Ì‚ÉŽ¸”s:%d",ans); - goto F; - } - - - /* */ - ans = saveTextToBinary(source, baseFileName, escapedText); - if (ans > 0) { - printf("ƒtƒ@ƒCƒ‹‚ðƒZ[ƒu‚·‚é‚Ì‚ÉŽ¸”s:%d", ans); - goto G; - } - -G: - free(escapedText); - -F: - free(escapedNoBOMText); - -E: - free(escapedNoBOMWideText); - -D: - free(wideNoBOMtext); - -C: - free(noBOMtext); - -B: - free(importText); - -A: - return ans; -} diff --git a/ConsoleApplication3/ReadMe.txt b/ConsoleApplication3/ReadMe.txt deleted file mode 100644 index 8eaedfa..0000000 --- a/ConsoleApplication3/ReadMe.txt +++ /dev/null @@ -1,30 +0,0 @@ -======================================================================== - コンソール アプリケーション: ConsoleApplication3 プロジェクトã®æ¦‚è¦ -======================================================================== - -ã“ã® ConsoleApplication3 アプリケーションã¯ã€AppWizard ã«ã‚ˆã‚Šä½œæˆã•ã‚Œã¾ã—ãŸã€‚ - -ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ã«ã¯ã€ConsoleApplication3 アプリケーションを構æˆã™ã‚‹å„ファイルã®å†…容ã®æ¦‚è¦ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ - - -ConsoleApplication3.vcxproj - ã“ã‚Œã¯ã€ã‚¢ãƒ—リケーション ウィザードを使用ã—ã¦ç”Ÿæˆã•ã‚ŒãŸ VC++ プロジェクトã®ãƒ¡ã‚¤ãƒ³ プロジェクト ファイルã§ã™ã€‚ファイルを生æˆã—㟠Visual C++ ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«é–¢ã™ã‚‹æƒ…å ±ã¨ã€ã‚¢ãƒ—リケーション ウィザードã§é¸æŠžã•ã‚ŒãŸãƒ—ラットフォームã€æ§‹æˆã€ãŠã‚ˆã³ãƒ—ロジェクト機能ã«é–¢ã™ã‚‹æƒ…å ±ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ - -ConsoleApplication3.vcxproj.filters - ã“ã‚Œã¯ã€ã‚¢ãƒ—リケーション ウィザードã§ç”Ÿæˆã•ã‚ŒãŸ VC++ プロジェクトã®ãƒ•ã‚£ãƒ«ã‚¿ãƒ¼ ファイルã§ã™ã€‚ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ã«ã¯ã€ãƒ—ロジェクト内ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¨ãƒ•ã‚£ãƒ«ã‚¿ãƒ¼ã¨ã®é–“ã®é–¢é€£ä»˜ã‘ã«é–¢ã™ã‚‹æƒ…å ±ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ã“ã®é–¢é€£ä»˜ã‘ã¯ã€ç‰¹å®šã®ãƒŽãƒ¼ãƒ‰ã§åŒæ§˜ã®æ‹¡å¼µå­ã‚’æŒã¤ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚°ãƒ«ãƒ¼ãƒ—化を示ã™ãŸã‚ã« IDE ã§ä½¿ç”¨ã•ã‚Œã¾ã™ (ãŸã¨ãˆã°ã€".cpp" ファイル㯠"ソース ファイル" フィルターã«é–¢é€£ä»˜ã‘られã¦ã„ã¾ã™)。 - -ConsoleApplication3.cpp - ã“ã‚Œã¯ã€ãƒ¡ã‚¤ãƒ³ã®ã‚¢ãƒ—リケーション ソース ファイルã§ã™ã€‚ - -///////////////////////////////////////////////////////////////////////////// -ãã®ä»–ã®æ¨™æº–ファイル : - -StdAfx.h, StdAfx.cpp - ã“れらã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯ã€ConsoleApplication3.pch ã¨ã„ã†åå‰ã®ãƒ—リコンパイル済ã¿ãƒ˜ãƒƒãƒ€ãƒ¼ (PCH) ファイルã¨ã€StdAfx.obj ã¨ã„ã†åå‰ã®ãƒ—リコンパイル済ã¿ã®åž‹ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ビルドã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚ - -///////////////////////////////////////////////////////////////////////////// -ãã®ä»–ã®ãƒ¡ãƒ¢ : - -AppWizard ã§ã¯ "TODO:" コメントを使用ã—ã¦ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒè¿½åŠ ã¾ãŸã¯ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºã™ã‚‹å¿…è¦ã®ã‚るソース コードを示ã—ã¾ã™ã€‚ - -///////////////////////////////////////////////////////////////////////////// diff --git a/ConsoleApplication3/stdafx.cpp b/ConsoleApplication3/stdafx.cpp deleted file mode 100644 index 9370649..0000000 --- a/ConsoleApplication3/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : •W€ƒCƒ“ƒNƒ‹[ƒh ConsoleApplication3.pch ‚Ì‚Ý‚ð -// ŠÜ‚Þƒ\[ƒX ƒtƒ@ƒCƒ‹‚ÍAƒvƒŠƒRƒ“ƒpƒCƒ‹Ï‚݃wƒbƒ_[‚É‚È‚è‚Ü‚·B -// stdafx.obj ‚ɂ̓vƒŠƒRƒ“ƒpƒCƒ‹Ï‚ÝŒ^î•ñ‚ªŠÜ‚Ü‚ê‚Ü‚·B - -#include "stdafx.h" - -// TODO: ‚±‚̃tƒ@ƒCƒ‹‚Å‚Í‚È‚­ASTDAFX.H ‚Å•K—v‚È -// ’ljÁƒwƒbƒ_[‚ðŽQÆ‚µ‚Ä‚­‚¾‚³‚¢B diff --git a/ConsoleApplication3/stdafx.h b/ConsoleApplication3/stdafx.h deleted file mode 100644 index 472c4ea..0000000 --- a/ConsoleApplication3/stdafx.h +++ /dev/null @@ -1,20 +0,0 @@ -// stdafx.h : •W€‚̃VƒXƒeƒ€ ƒCƒ“ƒNƒ‹[ƒh ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒNƒ‹[ƒh ƒtƒ@ƒCƒ‹A‚Ü‚½‚Í -// ŽQƉñ”‚ª‘½‚­A‚©‚‚ ‚Ü‚è•ÏX‚³‚ê‚È‚¢AƒvƒƒWƒFƒNƒgê—p‚̃Cƒ“ƒNƒ‹[ƒh ƒtƒ@ƒCƒ‹ -// ‚ð‹Lq‚µ‚Ü‚·B -// - -#pragma once - -#include "targetver.h" - -#include -#include - -#include - -#include - -#include - - -// TODO: ƒvƒƒOƒ‰ƒ€‚É•K—v‚ȒljÁƒwƒbƒ_[‚ð‚±‚±‚ÅŽQÆ‚µ‚Ä‚­‚¾‚³‚¢ diff --git a/ConsoleApplication3/targetver.h b/ConsoleApplication3/targetver.h deleted file mode 100644 index 10b7ccd..0000000 --- a/ConsoleApplication3/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// SDKDDKVer.h ‚ðƒCƒ“ƒNƒ‹[ƒh‚·‚é‚ÆA—˜—p‚Å‚«‚éÅ‚àãˆÊ‚Ì Windows ƒvƒ‰ƒbƒgƒtƒH[ƒ€‚ª’è‹`‚³‚ê‚Ü‚·B - -// ˆÈ‘O‚Ì Windows ƒvƒ‰ƒbƒgƒtƒH[ƒ€—p‚ɃAƒvƒŠƒP[ƒVƒ‡ƒ“‚ðƒrƒ‹ƒh‚·‚éꇂÍAWinSDKVer.h ‚ðƒCƒ“ƒNƒ‹[ƒh‚µA -// SDKDDKVer.h ‚ðƒCƒ“ƒNƒ‹[ƒh‚·‚é‘O‚ÉAƒTƒ|[ƒg‘ÎÛ‚Æ‚·‚éƒvƒ‰ƒbƒgƒtƒH[ƒ€‚ðŽ¦‚·‚悤‚É _WIN32_WINNT ƒ}ƒNƒ‚ðݒ肵‚Ü‚·B - -#include diff --git a/README.md b/README.md index e5d498c..98f8d0a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## 環境  Windows7 以上 -## 使ã„ã‹ãŸãƒ‘ターン1 +## 使ã„ã‹ãŸãƒ‘ターン1(localisationã®ymlファイル) é©å½“ãªãƒ•ã‚©ãƒ«ãƒ€ã‚’用æ„ã—ã¾ã™ã€‚ 変æ›ã—ãŸã„テキストãŒå…¥ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’下記ã«æ³¨æ„ã—ã¦ã€ä¸Šè¨˜ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ä¿å­˜ã—ã¦ãã ã•ã„。上記ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ã•ã‚‰ã«ãƒ•ã‚©ãƒ«ãƒ€ã‚’作ã£ã¦ãã®ä¸­ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’ç½®ãよã†ãªéšŽå±¤æ§‹é€ ã«ã—ã¦ã‚‚大丈夫ã§ã™ã€‚ @@ -13,9 +13,9 @@ - BOM付ãã®UTF-8 - ファイルåã‚’xxx.utf8b.yyyã«ã™ã‚‹ã€‚xxxã¯ä»»æ„ã®æ–‡å­—列。yyyã¯a~zã¨A~Zã¨0~9ã®ã¿ä½¿ç”¨å¯èƒ½ -上記ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’ã€ConsoleApplication3.exeã«ãƒ‰ãƒ©ãƒƒã‚°ã‚¢ãƒ³ãƒ‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¦ãã ã•ã„。フォルダ内ã«ã€xxx.yyyã¨ã—ã¦å¤‰æ›ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆãŒä¿å­˜ã•ã‚Œã¾ã™ã€‚ +上記ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’ã€eu4specialescape.exeã«ãƒ‰ãƒ©ãƒƒã‚°ã‚¢ãƒ³ãƒ‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¦ãã ã•ã„。フォルダ内ã«ã€xxx.yyyã¨ã—ã¦å¤‰æ›ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆãŒä¿å­˜ã•ã‚Œã¾ã™ã€‚ -## 使ã„方パターン2 +## 使ã„方パターン2(localisationã®ymlファイル) é©å½“ãªãƒ•ã‚©ãƒ«ãƒ€ã‚’用æ„ã—ã¾ã™ã€‚ 変æ›ã—ãŸã„テキストãŒå…¥ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’下記ã«æ³¨æ„ã—ã¦ã€ä¸Šè¨˜ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ä¿å­˜ã—ã¦ãã ã•ã„。上記ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ã•ã‚‰ã«ãƒ•ã‚©ãƒ«ãƒ€ã‚’作ã£ã¦ãã®ä¸­ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’ç½®ãよã†ãªéšŽå±¤æ§‹é€ ã«ã—ã¦ã‚‚大丈夫ã§ã™ã€‚ @@ -23,10 +23,17 @@ - BOMãªã—ã®UTF-8 - ファイルåã‚’xxx.yyy.utf8ã«ã™ã‚‹ã€‚xxxã¯ä»»æ„ã®æ–‡å­—列。yyyã¯a~zã¨A~Zã¨0~9ã¨ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)ã®ã¿ä½¿ç”¨å¯èƒ½ -上記ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’ã€ConsoleApplication3.exeã«ãƒ‰ãƒ©ãƒƒã‚°ã‚¢ãƒ³ãƒ‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¦ãã ã•ã„。フォルダ内ã«ã€xxx.yyyã¨ã—ã¦å¤‰æ›ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆãŒä¿å­˜ã•ã‚Œã¾ã™ã€‚ +上記ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’ã€eu4specialescape.exeã«ãƒ‰ãƒ©ãƒƒã‚°ã‚¢ãƒ³ãƒ‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¦ãã ã•ã„。フォルダ内ã«ã€xxx.yyyã¨ã—ã¦å¤‰æ›ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆãŒä¿å­˜ã•ã‚Œã¾ã™ã€‚ -## ビルドã®ä»•æ–¹ - VC2015以上ã§ConsoleApplication3.slnã‚’é–‹ãã€ãƒ“ルドã—ã¦ãã ã•ã„。 +## 使ã„方パターン3(ymlファイル以外ã®ãƒ•ã‚¡ã‚¤ãƒ«ã€‚txtファイルãªã©ï¼‰ +é©å½“ãªãƒ•ã‚©ãƒ«ãƒ€ã‚’用æ„ã—ã¾ã™ã€‚ + +変æ›ã—ãŸã„テキストãŒå…¥ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’下記ã«æ³¨æ„ã—ã¦ã€ä¸Šè¨˜ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ä¿å­˜ã—ã¦ãã ã•ã„。上記ã®ãƒ•ã‚©ãƒ«ãƒ€å†…ã«ã•ã‚‰ã«ãƒ•ã‚©ãƒ«ãƒ€ã‚’作ã£ã¦ãã®ä¸­ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’ç½®ãよã†ãªéšŽå±¤æ§‹é€ ã«ã—ã¦ã‚‚大丈夫ã§ã™ã€‚ -## ライセンス - MITライセンス \ No newline at end of file + - BOMãªã—ã®UTF-8 + - ファイルåã‚’xxx.yyy.utf8toCP1252ã«ã™ã‚‹ã€‚xxxã¯ä»»æ„ã®æ–‡å­—列。yyyã¯a~zã¨A~Zã¨0~9ã¨ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)ã®ã¿ä½¿ç”¨å¯èƒ½ + +上記ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’ã€eu4specialescape.exeã«ãƒ‰ãƒ©ãƒƒã‚°ã‚¢ãƒ³ãƒ‰ãƒ‰ãƒ­ãƒƒãƒ—ã—ã¦ãã ã•ã„。フォルダ内ã«ã€xxx.yyyã¨ã—ã¦å¤‰æ›ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆãŒä¿å­˜ã•ã‚Œã¾ã™ã€‚ + +## ビルドã®ä»•æ–¹ + VC2015以上ã§eu4specialescape.slnã‚’é–‹ãã€ãƒ“ルドã—ã¦ãã ã•ã„。 diff --git a/eu4specialescape/eu4specialescape.cpp b/eu4specialescape/eu4specialescape.cpp new file mode 100644 index 0000000..b62cfa0 Binary files /dev/null and b/eu4specialescape/eu4specialescape.cpp differ diff --git a/eu4specialescape/eu4specialescape.sln b/eu4specialescape/eu4specialescape.sln new file mode 100644 index 0000000..7dea7be --- /dev/null +++ b/eu4specialescape/eu4specialescape.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2003 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eu4specialescape", "eu4specialescape.vcxproj", "{7DDE02BC-6971-4E3A-B435-D5E77725708B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Debug|x64.ActiveCfg = Debug|x64 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Debug|x64.Build.0 = Debug|x64 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Debug|x86.ActiveCfg = Debug|Win32 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Debug|x86.Build.0 = Debug|Win32 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Release|x64.ActiveCfg = Release|x64 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Release|x64.Build.0 = Release|x64 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Release|x86.ActiveCfg = Release|Win32 + {7DDE02BC-6971-4E3A-B435-D5E77725708B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3CEDFC67-F345-4342-8E91-B1AA4F6AB757} + EndGlobalSection +EndGlobal diff --git a/ConsoleApplication3/ConsoleApplication3.vcxproj b/eu4specialescape/eu4specialescape.vcxproj similarity index 87% rename from ConsoleApplication3/ConsoleApplication3.vcxproj rename to eu4specialescape/eu4specialescape.vcxproj index 35f05da..69ff07d 100644 --- a/ConsoleApplication3/ConsoleApplication3.vcxproj +++ b/eu4specialescape/eu4specialescape.vcxproj @@ -1,5 +1,5 @@ - - + + Debug @@ -19,35 +19,36 @@ - {9003FC25-A6B5-451B-BDAE-B764FDAB37E1} + 15.0 + {7DDE02BC-6971-4E3A-B435-D5E77725708B} Win32Proj - ConsoleApplication3 - 8.1 + eu4specialescape + 10.0.17134.0 Application true - v140 + v141 Unicode Application false - v140 + v141 true Unicode Application true - v140 + v141 Unicode Application false - v140 + v141 true Unicode @@ -86,8 +87,10 @@ Use Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h Console @@ -99,8 +102,10 @@ Use Level3 Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h Console @@ -109,13 +114,15 @@ - Level3 Use + Level3 MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h Console @@ -126,13 +133,15 @@ - Level3 Use + Level3 MaxSpeed true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h Console @@ -142,15 +151,11 @@ - - - - - + - - + + Create Create Create diff --git a/ConsoleApplication3/ConsoleApplication3.vcxproj.filters b/eu4specialescape/eu4specialescape.vcxproj.filters similarity index 74% rename from ConsoleApplication3/ConsoleApplication3.vcxproj.filters rename to eu4specialescape/eu4specialescape.vcxproj.filters index bfeb903..30429d7 100644 --- a/ConsoleApplication3/ConsoleApplication3.vcxproj.filters +++ b/eu4specialescape/eu4specialescape.vcxproj.filters @@ -7,7 +7,7 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -15,21 +15,15 @@ - - - - - ヘッダー ファイル - - + ヘッダー ファイル - + ソース ファイル - + ソース ファイル diff --git a/eu4specialescape/pch.cpp b/eu4specialescape/pch.cpp new file mode 100644 index 0000000..ae0fa0e Binary files /dev/null and b/eu4specialescape/pch.cpp differ diff --git a/eu4specialescape/pch.h b/eu4specialescape/pch.h new file mode 100644 index 0000000..56c1299 Binary files /dev/null and b/eu4specialescape/pch.h differ