Skip to content

Commit

Permalink
정렬 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LocketGoma committed Nov 29, 2019
1 parent 3407f1a commit 66e1be6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 41 deletions.
45 changes: 5 additions & 40 deletions Addon_BBCC_DCconEditor_AUTO/FileEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,62 +228,27 @@ string covert_input_manager(string input) {
void list_entry_writer_ASC() { //완성된 리스트를 쓰는 부분 (자동 정렬)
//일단 임시
string temp;
string midpoint;
string output;
ofstream ofile(temp_file); //반드시 엔트리 오픈보다 나중에 실행될것.)
ofstream ofile(temp_file); //반드시 엔트리 오픈보다 나중에 실행될것.
bool end_line = false;
bool temp_comma = false;
bool clear_start = true;
dcconlist->seekg(0);

//sort(entry_list.begin(),entry_list.end());

if (ofile.is_open()) {
while (!dcconlist->eof()) {
getline(*dcconlist, temp);
//---비교부분
if (temp.find("name") == string::npos) {
if (end_line == true)
break;

ofile << "dcConsData = [";
end_line = true;
continue;
}
midpoint = temp.substr(midpoint.find("name") + 9, temp.find(""",") - (temp.find("name") + 7));
output = convert_to_cp949(midpoint.c_str());
temp.substr(temp.size() - 1, 1) == "," ? temp_comma = true : temp_comma = false; //마지막에 출력한 문장이 ','가 있었는지 여부.
#ifdef DEBUG
cout << output << endl;
#endif
entry_iter = entry_list.find(output);
if (entry_iter != entry_list.end()) {
if (entry_iter->second != 0) {
if (end_line == true)
ofile << endl;
ofile << temp;
}
else {
continue;
}
}
}
ofile << "dcConsData = [";
entry_list.empty() == true ? clear_start = true : clear_start = false; //빈 파일이었는지 여부

for (list_iter = name_list.begin(); list_iter != name_list.end(); ++list_iter) {
if (list_iter->second == false) {
list_iter = name_list.begin();
for (; list_iter != name_list.end(); ++list_iter) {
if (!clear_start && !temp_comma)
ofile << ",";
ofile << endl;
clear_start = false;
temp_comma = false;
string tp = covert_input_manager(list_iter->first);
ofile << tp;
list_iter->second = true;
}

list_iter->second = true;
}

}
ofile << "\n ];" << endl;

Expand Down
2 changes: 1 addition & 1 deletion Addon_BBCC_DCconEditor_AUTO/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void DCCon_Editor::display() {
while (true) {
system("cls");
cout << "\n\t\tBBCC 디시콘 리스트 에디터\n\n" << endl;
cout << "v0.57\t\t\t\t\tmake by @locketgoma\n\n" << endl;
cout << "v0.65\t\t\t\t\tmake by @locketgoma\n\n" << endl;
cout << "현재 시스템 로드 상태 : 리스트 로드 - " << (status_list_load==1 ? "true" : "false");
cout << " // 엔트리 로드 - " << (status_entry_load==1 ? "true" : "false");
cout << " // 파일 수정 준비 - " << (status_ready ==1 ? "완료" : "");
Expand Down

0 comments on commit 66e1be6

Please sign in to comment.