Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
Libraries
json
Commits
7c385a48
Commit
7c385a48
authored
Oct 03, 2018
by
Antonio Borondo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error: 'wide_string_input_helper' was not declared in this scope
parent
9ba3f796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
90 deletions
+92
-90
include/nlohmann/detail/input/input_adapters.hpp
include/nlohmann/detail/input/input_adapters.hpp
+45
-45
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+47
-45
No files found.
include/nlohmann/detail/input/input_adapters.hpp
View file @
7c385a48
...
...
@@ -115,51 +115,6 @@ class input_buffer_adapter : public input_adapter_protocol
const
char
*
const
limit
;
};
template
<
typename
WideStringType
>
class
wide_string_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
wide_string_input_adapter
(
const
WideStringType
&
w
)
:
str
(
w
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
// check if buffer needs to be filled
if
(
utf8_bytes_index
==
utf8_bytes_filled
)
{
fill_buffer
<
sizeof
(
typename
WideStringType
::
value_type
)
>
();
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
==
0
);
}
// use buffer
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
<
utf8_bytes_filled
);
return
utf8_bytes
[
utf8_bytes_index
++
];
}
private:
template
<
size_t
T
>
void
fill_buffer
()
{
wide_string_input_helper
<
WideStringType
,
T
>::
fill_buffer
(
str
,
current_wchar
,
utf8_bytes
,
utf8_bytes_index
,
utf8_bytes_filled
);
}
/// the wstring to process
const
WideStringType
&
str
;
/// index of the current wchar in str
std
::
size_t
current_wchar
=
0
;
/// a buffer for UTF-8 bytes
std
::
array
<
std
::
char_traits
<
char
>::
int_type
,
4
>
utf8_bytes
=
{{
0
,
0
,
0
,
0
}};
/// index to the utf8_codes array for the next valid byte
std
::
size_t
utf8_bytes_index
=
0
;
/// number of valid bytes in the utf8_codes array
std
::
size_t
utf8_bytes_filled
=
0
;
};
namespace
{
template
<
typename
WideStringType
,
size_t
T
>
...
...
@@ -279,6 +234,51 @@ namespace
};
}
template
<
typename
WideStringType
>
class
wide_string_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
wide_string_input_adapter
(
const
WideStringType
&
w
)
:
str
(
w
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
// check if buffer needs to be filled
if
(
utf8_bytes_index
==
utf8_bytes_filled
)
{
fill_buffer
<
sizeof
(
typename
WideStringType
::
value_type
)
>
();
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
==
0
);
}
// use buffer
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
<
utf8_bytes_filled
);
return
utf8_bytes
[
utf8_bytes_index
++
];
}
private:
template
<
size_t
T
>
void
fill_buffer
()
{
wide_string_input_helper
<
WideStringType
,
T
>::
fill_buffer
(
str
,
current_wchar
,
utf8_bytes
,
utf8_bytes_index
,
utf8_bytes_filled
);
}
/// the wstring to process
const
WideStringType
&
str
;
/// index of the current wchar in str
std
::
size_t
current_wchar
=
0
;
/// a buffer for UTF-8 bytes
std
::
array
<
std
::
char_traits
<
char
>::
int_type
,
4
>
utf8_bytes
=
{{
0
,
0
,
0
,
0
}};
/// index to the utf8_codes array for the next valid byte
std
::
size_t
utf8_bytes_index
=
0
;
/// number of valid bytes in the utf8_codes array
std
::
size_t
utf8_bytes_filled
=
0
;
};
class
input_adapter
{
public:
...
...
single_include/nlohmann/json.hpp
View file @
7c385a48
...
...
@@ -1993,51 +1993,6 @@ class input_buffer_adapter : public input_adapter_protocol
const
char
*
const
limit
;
};
template
<
typename
WideStringType
>
class
wide_string_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
wide_string_input_adapter
(
const
WideStringType
&
w
)
:
str
(
w
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
// check if buffer needs to be filled
if
(
utf8_bytes_index
==
utf8_bytes_filled
)
{
fill_buffer
<
sizeof
(
typename
WideStringType
::
value_type
)
>
();
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
==
0
);
}
// use buffer
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
<
utf8_bytes_filled
);
return
utf8_bytes
[
utf8_bytes_index
++
];
}
private:
template
<
size_t
T
>
void
fill_buffer
()
{
wide_string_input_helper
<
WideStringType
,
T
>::
fill_buffer
(
str
,
current_wchar
,
utf8_bytes
,
utf8_bytes_index
,
utf8_bytes_filled
);
}
/// the wstring to process
const
WideStringType
&
str
;
/// index of the current wchar in str
std
::
size_t
current_wchar
=
0
;
/// a buffer for UTF-8 bytes
std
::
array
<
std
::
char_traits
<
char
>::
int_type
,
4
>
utf8_bytes
=
{{
0
,
0
,
0
,
0
}};
/// index to the utf8_codes array for the next valid byte
std
::
size_t
utf8_bytes_index
=
0
;
/// number of valid bytes in the utf8_codes array
std
::
size_t
utf8_bytes_filled
=
0
;
};
namespace
{
template
<
typename
WideStringType
,
size_t
T
>
...
...
@@ -2157,6 +2112,53 @@ namespace
};
}
template
<
typename
WideStringType
>
class
wide_string_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
wide_string_input_adapter
(
const
WideStringType
&
w
)
:
str
(
w
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
// check if buffer needs to be filled
if
(
utf8_bytes_index
==
utf8_bytes_filled
)
{
fill_buffer
<
sizeof
(
typename
WideStringType
::
value_type
)
>
();
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
==
0
);
}
// use buffer
assert
(
utf8_bytes_filled
>
0
);
assert
(
utf8_bytes_index
<
utf8_bytes_filled
);
return
utf8_bytes
[
utf8_bytes_index
++
];
}
private:
template
<
size_t
T
>
void
fill_buffer
()
{
wide_string_input_helper
<
WideStringType
,
T
>::
fill_buffer
(
str
,
current_wchar
,
utf8_bytes
,
utf8_bytes_index
,
utf8_bytes_filled
);
}
/// the wstring to process
const
WideStringType
&
str
;
/// index of the current wchar in str
std
::
size_t
current_wchar
=
0
;
/// a buffer for UTF-8 bytes
std
::
array
<
std
::
char_traits
<
char
>::
int_type
,
4
>
utf8_bytes
=
{{
0
,
0
,
0
,
0
}};
/// index to the utf8_codes array for the next valid byte
std
::
size_t
utf8_bytes_index
=
0
;
/// number of valid bytes in the utf8_codes array
std
::
size_t
utf8_bytes_filled
=
0
;
};
class
input_adapter
{
public:
...
...
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