Precached images. ToobTuner. key additions.
This commit is contained in:
+47
-13
@@ -416,6 +416,9 @@ void json_reader::skip_property()
|
||||
int c = is_.peek();
|
||||
switch (c)
|
||||
{
|
||||
case -1:
|
||||
throw_format_error("Premature end of file.");
|
||||
break;
|
||||
case '[':
|
||||
skip_array();
|
||||
break;
|
||||
@@ -442,8 +445,10 @@ void json_reader::skip_string()
|
||||
consume('"');
|
||||
while (true)
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
c = get();
|
||||
if (c == -1) throw_format_error("Premature end of file.");
|
||||
|
||||
if (c == '\"')
|
||||
{
|
||||
if (peek() == '\"')
|
||||
@@ -463,27 +468,54 @@ void json_reader::skip_string()
|
||||
void json_reader::skip_number()
|
||||
{
|
||||
skip_whitespace();
|
||||
char c;
|
||||
while (true)
|
||||
int c;
|
||||
if (is_.peek() == '-')
|
||||
{
|
||||
int ic = is_.peek();
|
||||
if (ic == -1)
|
||||
break;
|
||||
if (is_whitespace((char)ic))
|
||||
get();
|
||||
}
|
||||
if (!std::isdigit(is_.peek()))
|
||||
{
|
||||
throw_format_error("Expecting a number.");
|
||||
}
|
||||
while (std::isdigit(is_.peek()))
|
||||
{
|
||||
get();
|
||||
}
|
||||
if (is_.peek() == '.')
|
||||
{
|
||||
get();
|
||||
}
|
||||
while (std::isdigit(is_.peek()))
|
||||
{
|
||||
get();
|
||||
}
|
||||
c = is_.peek();
|
||||
if (c == 'e' || c == 'E')
|
||||
{
|
||||
get();
|
||||
c = is_.peek();
|
||||
if (c == '+' || c == 'i')
|
||||
{
|
||||
break;
|
||||
get();
|
||||
}
|
||||
c = get();
|
||||
while (std::isdigit(is_.peek()))
|
||||
{
|
||||
get();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
void json_reader::skip_array()
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
consume('[');
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (peek() == ']')
|
||||
c = peek();
|
||||
if (c == -1) throw_format_error("Premature end of file.");
|
||||
|
||||
if (c == ']')
|
||||
{
|
||||
c = get();
|
||||
break;
|
||||
@@ -499,11 +531,13 @@ void json_reader::skip_array()
|
||||
|
||||
void json_reader::skip_object()
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
consume('{');
|
||||
while (true)
|
||||
{
|
||||
if (peek() == '}')
|
||||
c = peek();
|
||||
if (c == -1) throw_format_error("Premature end of file.");
|
||||
if (c == '}')
|
||||
{
|
||||
c = get();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user