Skip to content

Commit

Permalink
Update my-gists
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Apr 21, 2023
1 parent 47905a6 commit b5e28f6
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 45 deletions.
3 changes: 2 additions & 1 deletion src/GhostSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "my-gists/windows/LoadStringFromResource.hpp"
#include "my-gists/ukagaka/SSP_Runner.hpp"
#include "my-gists/ukagaka/ghost_path.hpp"
#include "my-gists/ukagaka/from_ghost_path.hpp"

LRESULT CALLBACK GhostSelectDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);

Expand Down Expand Up @@ -125,7 +126,7 @@ void GhostSelection(HINSTANCE hInstance) {
continue;
ghost_path = i.second[L"ghostpath"] + L"ghost\\master\\";
ghost_uid = i.second.ID;
ghost_shiori = get_shiori_path(ghost_path);
ghost_shiori = from_ghost_path::get_shiori_path(ghost_path);
//
has_shiori_file_info = !ghost_shiori.empty();
}
Expand Down
28 changes: 0 additions & 28 deletions src/GhostStuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,6 @@ void unload_shiori_of_baseware() {
shiorimode = not_in_loading;
}

wstring get_shiori_path(wstring ghost_path) {
auto descript_name = ghost_path + L"descript.txt";
auto descript_f = _wfopen(descript_name.c_str(), L"rb");
//
CODEPAGE_n::CODEPAGE cp = CODEPAGE_n::CP_UTF8;
char buf[2048];
wstring line, s0, s1;
if(descript_f) {
while(fgets(buf, 2048, descript_f)) {
line = CODEPAGE_n::MultiByteToUnicode(buf, cp);
auto len = line.size();
if(len && *line.rbegin() == L'\n')
line.resize(--len);
if(len && *line.rbegin() == L'\r')
line.resize(--len);
Split(line, s0, s1, L",");
if(s0 == L"charset")
cp = CODEPAGE_n::StringtoCodePage(s1.c_str());
else if(s0 == L"shiori") {
fclose(descript_f);
return ghost_path + s1;
}
}
fclose(descript_f);
}
return {};
}

void UpdateGhostModulestate() {
if(ghost_uid.empty())
return;
Expand Down
1 change: 1 addition & 0 deletions src/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "header_files/Parameter.hpp"
#include "header_files/UItools.hpp"
#include "my-gists/file/canXfile.hpp"
#include "my-gists/STL/Split.hpp"
#include "my-gists/ukagaka/ghost_path.hpp"
#include <dwmapi.h>

Expand Down
11 changes: 0 additions & 11 deletions src/ToolFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ int StrToInt(wstring_view str) {
return result;
}

bool Split(wstring &str, wstring &s0, wstring &s1, wstring_view sepstr) {
// strをs0とs1に分解
auto begin = str.find(sepstr);
s0 = str.substr(0, begin);
s1 = str.substr(begin + sepstr.size());
CutSpace(s0);
CutSpace(s1);

return begin != wstring::npos;
}

wchar_t *setlocaleauto(int category) {
// OSデフォルトの言語IDでロケール設定する
switch(PRIMARYLANGID(GetSystemDefaultLangID())) {
Expand Down
7 changes: 6 additions & 1 deletion src/_gists.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#include "my-gists/file/canXfile.cpp"
#include "my-gists/windows/SetIcon.cpp"

#include "my-gists/ukagaka/shiori_loader.cpp"
#include "my-gists/ukagaka/SSP_Runner.cpp"
#include "my-gists/ukagaka/ghost_path.cpp"
#include "my-gists/ukagaka/from_ghost_path.cpp"
#include "my-gists/ukagaka/SFMO.cpp"

#include "my-gists/windows/GenerateDump.cpp"
#include "my-gists/windows/SetIcon.cpp"
#include "my-gists/windows/LoadStringFromResource.cpp"

#include "my-gists/STL/CutSpace.cpp"
#include "my-gists/STL/Split.cpp"
3 changes: 1 addition & 2 deletions src/header_files/GhostStuff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ void LostGhostLink();
void reload_shiori_of_baseware();
void unload_shiori_of_baseware();

std::wstring get_shiori_path(std::wstring ghost_path);
void UpdateGhostModulestate();
void UpdateGhostModulestate();

bool ExecLoad(void);
void ExecRequest(const wchar_t* str);
Expand Down
1 change: 0 additions & 1 deletion src/header_files/ToolFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ using namespace std;

int HexStrToInt(wstring_view str);
int StrToInt(wstring_view str);
bool Split(wstring &str, wstring &s0, wstring &s1, wstring_view sepstr);
wchar_t *setlocaleauto(int category);

0 comments on commit b5e28f6

Please sign in to comment.