Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
a0623d95
Commit
a0623d95
authored
Dec 06, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UTF8::uni_iter made leaner.
parent
391ff669
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
UTF8.cpp
tools/UTF8.cpp
+8
-8
No files found.
tools/UTF8.cpp
View file @
a0623d95
...
...
@@ -59,11 +59,11 @@ public:
return
wxString
(
c_str
(),
wxConvUTF8
);
}
static
int
uni_forward
(
const_iterator
it
,
uint32_t
*
result
)
static
int
uni_forward
(
unsigned
char
*
it
,
uint32_t
*
result
)
{
// @todo: have this read UTF8 characters into result, not bytes.
// What's here now is scaffolding, reading single byte characters only.
*
result
=
(
unsigned
char
)
*
it
;
*
result
=
*
it
;
return
1
;
}
...
...
@@ -74,13 +74,13 @@ public:
* they return a uint32_t holding the unicode character appropriate for respective
* operation.
*/
class
uni_iter
:
public
std
::
string
::
const_iterator
class
uni_iter
{
const_iterator
it
;
unsigned
char
*
it
;
public
:
uni_iter
(
const
_iterator
start
)
:
it
(
start
)
uni_iter
(
const
char
*
start
)
:
it
(
(
unsigned
char
*
)
start
)
{
}
...
...
@@ -138,12 +138,12 @@ public:
uni_iter
ubegin
()
const
{
return
uni_iter
(
begin
()
);
return
uni_iter
(
data
()
);
}
uni_iter
uend
()
const
{
return
uni_iter
(
end
()
);
return
uni_iter
(
data
()
+
size
()
);
}
};
...
...
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