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
List
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
YGOPRO-520DIY
ygopro
Commits
39553f99
Commit
39553f99
authored
Oct 11, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add BufferIO::CopyWideString
parent
e3264fff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
gframe/bufferio.h
gframe/bufferio.h
+11
-0
No files found.
gframe/bufferio.h
View file @
39553f99
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define BUFFERIO_H
#define BUFFERIO_H
#include <cstdint>
#include <cstdint>
#include <cwchar>
#include "../ocgcore/buffer.h"
#include "../ocgcore/buffer.h"
class
BufferIO
{
class
BufferIO
{
...
@@ -49,6 +50,16 @@ public:
...
@@ -49,6 +50,16 @@ public:
*
pstr
=
0
;
*
pstr
=
0
;
return
l
;
return
l
;
}
}
template
<
size_t
N
>
static
void
CopyString
(
const
char
*
src
,
wchar_t
(
&
dst
)[
N
])
{
dst
[
0
]
=
0
;
std
::
strncat
(
dst
,
src
,
N
-
1
);
}
template
<
size_t
N
>
static
void
CopyWideString
(
const
wchar_t
*
src
,
wchar_t
(
&
dst
)[
N
])
{
dst
[
0
]
=
0
;
std
::
wcsncat
(
dst
,
src
,
N
-
1
);
}
template
<
typename
T
>
template
<
typename
T
>
static
bool
CheckUTF8Byte
(
const
T
*
str
,
int
len
)
{
static
bool
CheckUTF8Byte
(
const
T
*
str
,
int
len
)
{
for
(
int
i
=
1
;
i
<
len
;
++
i
)
{
for
(
int
i
=
1
;
i
<
len
;
++
i
)
{
...
...
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