Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
a19ff045
Commit
a19ff045
authored
Jul 25, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
left changes
Change-Id: Ia059475841baf25fbee6978c5201afb0fee6d8aa
parent
192d80e4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
Makefile
Makefile
+2
-9
json_to_pb.cpp
json2pb/json_to_pb.cpp
+8
-8
No files found.
Makefile
View file @
a19ff045
...
@@ -287,7 +287,6 @@ clean:ccpclean
...
@@ -287,7 +287,6 @@ clean:ccpclean
rm
-rf
json2pb/json2pb_json_to_pb.o
rm
-rf
json2pb/json2pb_json_to_pb.o
rm
-rf
json2pb/json2pb_pb_to_json.o
rm
-rf
json2pb/json2pb_pb_to_json.o
rm
-rf
json2pb/json2pb_protobuf_map.o
rm
-rf
json2pb/json2pb_protobuf_map.o
rm
-rf
json2pb/json2pb_string_printf.o
rm
-rf
mcpack2pb/mcpack2pb_field_type.o
rm
-rf
mcpack2pb/mcpack2pb_field_type.o
rm
-rf
mcpack2pb/mcpack2pb_mcpack2pb.o
rm
-rf
mcpack2pb/mcpack2pb_mcpack2pb.o
rm
-rf
mcpack2pb/mcpack2pb_parser.o
rm
-rf
mcpack2pb/mcpack2pb_parser.o
...
@@ -900,14 +899,12 @@ libbthread.a:bthread/bthread_bthread.o \
...
@@ -900,14 +899,12 @@ libbthread.a:bthread/bthread_bthread.o \
libjson2pb.a
:
json2pb/json2pb_encode_decode.o
\
libjson2pb.a
:
json2pb/json2pb_encode_decode.o
\
json2pb/json2pb_json_to_pb.o
\
json2pb/json2pb_json_to_pb.o
\
json2pb/json2pb_pb_to_json.o
\
json2pb/json2pb_pb_to_json.o
\
json2pb/json2pb_protobuf_map.o
\
json2pb/json2pb_protobuf_map.o
json2pb/json2pb_string_printf.o
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mlibjson2pb.a[0m']"
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mlibjson2pb.a[0m']"
ar crs libjson2pb.a json2pb/json2pb_encode_decode.o
\
ar crs libjson2pb.a json2pb/json2pb_encode_decode.o
\
json2pb/json2pb_json_to_pb.o
\
json2pb/json2pb_json_to_pb.o
\
json2pb/json2pb_pb_to_json.o
\
json2pb/json2pb_pb_to_json.o
\
json2pb/json2pb_protobuf_map.o
\
json2pb/json2pb_protobuf_map.o
json2pb/json2pb_string_printf.o
mkdir
-p
./output/lib
mkdir
-p
./output/lib
cp
-f
libjson2pb.a ./output/lib
cp
-f
libjson2pb.a ./output/lib
...
@@ -1954,10 +1951,6 @@ json2pb/json2pb_protobuf_map.o:json2pb/protobuf_map.cpp
...
@@ -1954,10 +1951,6 @@ json2pb/json2pb_protobuf_map.o:json2pb/protobuf_map.cpp
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mjson2pb/json2pb_protobuf_map.o[0m']"
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mjson2pb/json2pb_protobuf_map.o[0m']"
$(CXX)
-c
$(INCPATH)
$(DEP_INCPATH)
$(CPPFLAGS)
$(CXXFLAGS)
-o
json2pb/json2pb_protobuf_map.o json2pb/protobuf_map.cpp
$(CXX)
-c
$(INCPATH)
$(DEP_INCPATH)
$(CPPFLAGS)
$(CXXFLAGS)
-o
json2pb/json2pb_protobuf_map.o json2pb/protobuf_map.cpp
json2pb/json2pb_string_printf.o
:
json2pb/string_printf.cpp
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mjson2pb/json2pb_string_printf.o[0m']"
$(CXX)
-c
$(INCPATH)
$(DEP_INCPATH)
$(CPPFLAGS)
$(CXXFLAGS)
-o
json2pb/json2pb_string_printf.o json2pb/string_printf.cpp
mcpack2pb/mcpack2pb_field_type.o
:
mcpack2pb/field_type.cpp
mcpack2pb/mcpack2pb_field_type.o
:
mcpack2pb/field_type.cpp
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mmcpack2pb/mcpack2pb_field_type.o[0m']"
@
echo
"[[1;32;40mCOMAKE:BUILD[0m][Target:'[1;32;40mmcpack2pb/mcpack2pb_field_type.o[0m']"
$(CXX)
-c
$(INCPATH)
$(DEP_INCPATH)
$(CPPFLAGS)
$(CXXFLAGS)
-o
mcpack2pb/mcpack2pb_field_type.o mcpack2pb/field_type.cpp
$(CXX)
-c
$(INCPATH)
$(DEP_INCPATH)
$(CPPFLAGS)
$(CXXFLAGS)
-o
mcpack2pb/mcpack2pb_field_type.o mcpack2pb/field_type.cpp
...
...
json2pb/json_to_pb.cpp
View file @
a19ff045
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include "json_to_pb.h"
#include "json_to_pb.h"
#include "zero_copy_stream_reader.h" // ZeroCopyStreamReader
#include "zero_copy_stream_reader.h" // ZeroCopyStreamReader
#include "encode_decode.h"
#include "encode_decode.h"
#include "string_printf.h"
#include "
base/
string_printf.h"
#include "protobuf_map.h"
#include "protobuf_map.h"
#include "rapidjson.h"
#include "rapidjson.h"
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
if (!perr->empty()) { \
if (!perr->empty()) { \
perr->append(", ", 2); \
perr->append(", ", 2); \
} \
} \
::json2pb::string_appendf(perr, fmt, ##__VA_ARGS__);
\
base::string_appendf(perr, fmt, ##__VA_ARGS__);
\
} else { }
} else { }
namespace
json2pb
{
namespace
json2pb
{
...
@@ -37,15 +37,15 @@ static void string_append_value(const rapidjson::Value& value,
...
@@ -37,15 +37,15 @@ static void string_append_value(const rapidjson::Value& value,
}
else
if
(
value
.
IsBool
())
{
}
else
if
(
value
.
IsBool
())
{
output
->
append
(
value
.
GetBool
()
?
"true"
:
"false"
);
output
->
append
(
value
.
GetBool
()
?
"true"
:
"false"
);
}
else
if
(
value
.
IsInt
())
{
}
else
if
(
value
.
IsInt
())
{
string_appendf
(
output
,
"%d"
,
value
.
GetInt
());
base
::
string_appendf
(
output
,
"%d"
,
value
.
GetInt
());
}
else
if
(
value
.
IsUint
())
{
}
else
if
(
value
.
IsUint
())
{
string_appendf
(
output
,
"%u"
,
value
.
GetUint
());
base
::
string_appendf
(
output
,
"%u"
,
value
.
GetUint
());
}
else
if
(
value
.
IsInt64
())
{
}
else
if
(
value
.
IsInt64
())
{
string_appendf
(
output
,
"%ld"
,
value
.
GetInt64
());
base
::
string_appendf
(
output
,
"%ld"
,
value
.
GetInt64
());
}
else
if
(
value
.
IsUint64
())
{
}
else
if
(
value
.
IsUint64
())
{
string_appendf
(
output
,
"%lu"
,
value
.
GetUint64
());
base
::
string_appendf
(
output
,
"%lu"
,
value
.
GetUint64
());
}
else
if
(
value
.
IsDouble
())
{
}
else
if
(
value
.
IsDouble
())
{
string_appendf
(
output
,
"%f"
,
value
.
GetDouble
());
base
::
string_appendf
(
output
,
"%f"
,
value
.
GetDouble
());
}
else
if
(
value
.
IsString
())
{
}
else
if
(
value
.
IsString
())
{
output
->
push_back
(
'"'
);
output
->
push_back
(
'"'
);
output
->
append
(
value
.
GetString
(),
value
.
GetStringLength
());
output
->
append
(
value
.
GetString
(),
value
.
GetStringLength
());
...
@@ -72,7 +72,7 @@ inline bool value_invalid(const google::protobuf::FieldDescriptor* field, const
...
@@ -72,7 +72,7 @@ inline bool value_invalid(const google::protobuf::FieldDescriptor* field, const
}
}
err
->
append
(
"Invalid value `"
);
err
->
append
(
"Invalid value `"
);
string_append_value
(
value
,
err
);
string_append_value
(
value
,
err
);
string_appendf
(
err
,
"' for %sfield `%s' which SHOULD be %s"
,
base
::
string_appendf
(
err
,
"' for %sfield `%s' which SHOULD be %s"
,
optional
?
"optional "
:
""
,
optional
?
"optional "
:
""
,
field
->
full_name
().
c_str
(),
type
);
field
->
full_name
().
c_str
(),
type
);
}
}
...
...
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