Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro
Commits
f8ce1246
Commit
f8ce1246
authored
Sep 23, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format LoadLFListFromLineProvider
parent
f1b62cc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
31 deletions
+35
-31
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+35
-31
No files found.
gframe/deck_manager.cpp
View file @
f8ce1246
...
@@ -13,41 +13,45 @@ void DeckManager::LoadLFListFromLineProvider(const std::function<bool(char*, siz
...
@@ -13,41 +13,45 @@ void DeckManager::LoadLFListFromLineProvider(const std::function<bool(char*, siz
auto
cur
=
loadedLists
.
rend
();
auto
cur
=
loadedLists
.
rend
();
char
linebuf
[
256
]{};
char
linebuf
[
256
]{};
wchar_t
strBuffer
[
256
]{};
wchar_t
strBuffer
[
256
]{};
if
(
true
)
{
while
(
getLine
(
linebuf
,
sizeof
(
linebuf
)))
{
while
(
getLine
(
linebuf
,
sizeof
linebuf
))
{
if
(
linebuf
[
0
]
==
'#'
)
continue
;
if
(
linebuf
[
0
]
==
'#'
)
if
(
linebuf
[
0
]
==
'!'
)
{
continue
;
auto
len
=
std
::
strcspn
(
linebuf
,
"
\r\n
"
);
if
(
linebuf
[
0
]
==
'!'
)
{
linebuf
[
len
]
=
0
;
auto
len
=
std
::
strcspn
(
linebuf
,
"
\r\n
"
);
BufferIO
::
DecodeUTF8
(
&
linebuf
[
1
],
strBuffer
);
linebuf
[
len
]
=
0
;
LFList
newlist
;
BufferIO
::
DecodeUTF8
(
&
linebuf
[
1
],
strBuffer
);
newlist
.
listName
=
strBuffer
;
LFList
newlist
;
newlist
.
hash
=
0x7dfcee6a
;
newlist
.
listName
=
strBuffer
;
loadedLists
.
push_back
(
newlist
);
newlist
.
hash
=
0x7dfcee6a
;
cur
=
loadedLists
.
rbegin
();
loadedLists
.
push_back
(
newlist
);
continue
;
cur
=
loadedLists
.
rbegin
();
continue
;
}
if
(
cur
==
loadedLists
.
rend
())
continue
;
char
*
pos
=
linebuf
;
errno
=
0
;
auto
result
=
std
::
strtoul
(
pos
,
&
pos
,
10
);
if
(
errno
||
result
>
UINT32_MAX
)
continue
;
if
(
pos
==
linebuf
||
*
pos
!=
' '
)
continue
;
uint32_t
code
=
static_cast
<
uint32_t
>
(
result
);
errno
=
0
;
int
count
=
std
::
strtol
(
pos
,
&
pos
,
10
);
if
(
errno
)
continue
;
if
(
count
<
0
||
count
>
2
)
continue
;
cur
->
content
[
code
]
=
count
;
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
}
}
if
(
cur
==
loadedLists
.
rend
())
continue
;
char
*
pos
=
linebuf
;
errno
=
0
;
auto
result
=
std
::
strtoul
(
pos
,
&
pos
,
10
);
if
(
errno
||
result
>
UINT32_MAX
)
continue
;
if
(
pos
==
linebuf
||
*
pos
!=
' '
)
continue
;
uint32_t
code
=
static_cast
<
uint32_t
>
(
result
);
errno
=
0
;
int
count
=
std
::
strtol
(
pos
,
&
pos
,
10
);
if
(
errno
)
continue
;
if
(
count
<
0
||
count
>
2
)
continue
;
cur
->
content
[
code
]
=
count
;
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
}
}
if
(
insert
)
if
(
insert
)
{
_lfList
.
insert
(
_lfList
.
begin
(),
loadedLists
.
begin
(),
loadedLists
.
end
());
_lfList
.
insert
(
_lfList
.
begin
(),
loadedLists
.
begin
(),
loadedLists
.
end
());
}
else
{
else
_lfList
.
insert
(
_lfList
.
end
(),
loadedLists
.
begin
(),
loadedLists
.
end
());
_lfList
.
insert
(
_lfList
.
end
(),
loadedLists
.
begin
(),
loadedLists
.
end
());
}
}
}
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
,
bool
insert
)
{
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
,
bool
insert
)
{
FILE
*
fp
=
myfopen
(
path
,
"r"
);
FILE
*
fp
=
myfopen
(
path
,
"r"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment