Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
126082c3
Commit
126082c3
authored
Jul 10, 2017
by
tanderson-google
Committed by
Adam Cozzette
Jul 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add std:: namespace prefix to set and map (#3332)
* Remove using std::{set,map}
parent
b9c4daad
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
82 additions
and
84 deletions
+82
-84
conformance_test.cc
conformance/conformance_test.cc
+3
-3
conformance_test.h
conformance/conformance_test.h
+1
-1
csharp_field_base.cc
src/google/protobuf/compiler/csharp/csharp_field_base.cc
+2
-2
csharp_field_base.h
src/google/protobuf/compiler/csharp/csharp_field_base.h
+3
-3
csharp_message.cc
src/google/protobuf/compiler/csharp/csharp_message.cc
+4
-4
javanano_enum_field.cc
src/google/protobuf/compiler/javanano/javanano_enum_field.cc
+1
-1
javanano_enum_field.h
src/google/protobuf/compiler/javanano/javanano_enum_field.h
+3
-3
javanano_extension.cc
src/google/protobuf/compiler/javanano/javanano_extension.cc
+1
-1
javanano_extension.h
src/google/protobuf/compiler/javanano/javanano_extension.h
+1
-1
javanano_field.cc
src/google/protobuf/compiler/javanano/javanano_field.cc
+3
-3
javanano_field.h
src/google/protobuf/compiler/javanano/javanano_field.h
+3
-3
javanano_helpers.cc
src/google/protobuf/compiler/javanano/javanano_helpers.cc
+1
-1
javanano_helpers.h
src/google/protobuf/compiler/javanano/javanano_helpers.h
+1
-1
javanano_map_field.cc
src/google/protobuf/compiler/javanano/javanano_map_field.cc
+1
-1
javanano_map_field.h
src/google/protobuf/compiler/javanano/javanano_map_field.h
+1
-1
javanano_message.cc
src/google/protobuf/compiler/javanano/javanano_message.cc
+1
-1
javanano_message_field.cc
...ogle/protobuf/compiler/javanano/javanano_message_field.cc
+1
-1
javanano_message_field.h
...oogle/protobuf/compiler/javanano/javanano_message_field.h
+3
-3
javanano_params.h
src/google/protobuf/compiler/javanano/javanano_params.h
+2
-2
javanano_primitive_field.cc
...le/protobuf/compiler/javanano/javanano_primitive_field.cc
+1
-1
javanano_primitive_field.h
...gle/protobuf/compiler/javanano/javanano_primitive_field.h
+4
-4
objectivec_enum_field.cc
...gle/protobuf/compiler/objectivec/objectivec_enum_field.cc
+2
-2
objectivec_enum_field.h
...ogle/protobuf/compiler/objectivec/objectivec_enum_field.h
+1
-1
objectivec_extension.cc
...ogle/protobuf/compiler/objectivec/objectivec_extension.cc
+2
-2
objectivec_field.cc
src/google/protobuf/compiler/objectivec/objectivec_field.cc
+2
-2
objectivec_field.h
src/google/protobuf/compiler/objectivec/objectivec_field.h
+2
-2
objectivec_file.cc
src/google/protobuf/compiler/objectivec/objectivec_file.cc
+7
-7
objectivec_helpers.cc
...google/protobuf/compiler/objectivec/objectivec_helpers.cc
+9
-9
objectivec_helpers.h
src/google/protobuf/compiler/objectivec/objectivec_helpers.h
+3
-3
objectivec_map_field.cc
...ogle/protobuf/compiler/objectivec/objectivec_map_field.cc
+1
-1
objectivec_map_field.h
...oogle/protobuf/compiler/objectivec/objectivec_map_field.h
+1
-1
objectivec_message.cc
...google/protobuf/compiler/objectivec/objectivec_message.cc
+2
-2
objectivec_message.h
src/google/protobuf/compiler/objectivec/objectivec_message.h
+1
-1
objectivec_message_field.cc
.../protobuf/compiler/objectivec/objectivec_message_field.cc
+3
-3
objectivec_message_field.h
...e/protobuf/compiler/objectivec/objectivec_message_field.h
+2
-2
objectivec_oneof.h
src/google/protobuf/compiler/objectivec/objectivec_oneof.h
+1
-1
objectivec_primitive_field.cc
...rotobuf/compiler/objectivec/objectivec_primitive_field.cc
+1
-1
common.h
src/google/protobuf/stubs/common.h
+0
-2
googletest.h
src/google/protobuf/testing/googletest.h
+1
-1
No files found.
conformance/conformance_test.cc
View file @
126082c3
...
...
@@ -677,7 +677,7 @@ void ConformanceTestSuite::SetFailureList(const string& filename,
std
::
inserter
(
expected_to_fail_
,
expected_to_fail_
.
end
()));
}
bool
ConformanceTestSuite
::
CheckSetEmpty
(
const
set
<
string
>&
set_to_check
,
bool
ConformanceTestSuite
::
CheckSetEmpty
(
const
s
td
::
s
et
<
string
>&
set_to_check
,
const
std
::
string
&
write_to_file
,
const
std
::
string
&
msg
)
{
if
(
set_to_check
.
empty
())
{
...
...
@@ -685,7 +685,7 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
}
else
{
StringAppendF
(
&
output_
,
"
\n
"
);
StringAppendF
(
&
output_
,
"%s
\n\n
"
,
msg
.
c_str
());
for
(
set
<
string
>::
const_iterator
iter
=
set_to_check
.
begin
();
for
(
s
td
::
s
et
<
string
>::
const_iterator
iter
=
set_to_check
.
begin
();
iter
!=
set_to_check
.
end
();
++
iter
)
{
StringAppendF
(
&
output_
,
" %s
\n
"
,
iter
->
c_str
());
}
...
...
@@ -694,7 +694,7 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
if
(
!
write_to_file
.
empty
())
{
std
::
ofstream
os
(
write_to_file
);
if
(
os
)
{
for
(
set
<
string
>::
const_iterator
iter
=
set_to_check
.
begin
();
for
(
s
td
::
s
et
<
string
>::
const_iterator
iter
=
set_to_check
.
begin
();
iter
!=
set_to_check
.
end
();
++
iter
)
{
os
<<
*
iter
<<
"
\n
"
;
}
...
...
conformance/conformance_test.h
View file @
126082c3
...
...
@@ -205,7 +205,7 @@ class ConformanceTestSuite {
void
TestValidDataForType
(
google
::
protobuf
::
FieldDescriptor
::
Type
,
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>
values
);
bool
CheckSetEmpty
(
const
set
<
string
>&
set_to_check
,
bool
CheckSetEmpty
(
const
s
td
::
s
et
<
string
>&
set_to_check
,
const
std
::
string
&
write_to_file
,
const
std
::
string
&
msg
);
ConformanceTestRunner
*
runner_
;
int
successes_
;
...
...
src/google/protobuf/compiler/csharp/csharp_field_base.cc
View file @
126082c3
...
...
@@ -54,7 +54,7 @@ namespace compiler {
namespace
csharp
{
void
FieldGeneratorBase
::
SetCommonFieldVariables
(
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
// Note: this will be valid even though the tag emitted for packed and unpacked versions of
// repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which
// never effects the tag size.
...
...
@@ -92,7 +92,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
}
void
FieldGeneratorBase
::
SetCommonOneofFieldVariables
(
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"oneof_name"
]
=
oneof_name
();
(
*
variables
)[
"has_property_check"
]
=
oneof_name
()
+
"Case_ == "
+
oneof_property_name
()
+
...
...
src/google/protobuf/compiler/csharp/csharp_field_base.h
View file @
126082c3
...
...
@@ -66,14 +66,14 @@ class FieldGeneratorBase : public SourceGeneratorBase {
protected
:
const
FieldDescriptor
*
descriptor_
;
const
int
fieldOrdinal_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
void
AddDeprecatedFlag
(
io
::
Printer
*
printer
);
void
AddNullCheck
(
io
::
Printer
*
printer
);
void
AddNullCheck
(
io
::
Printer
*
printer
,
const
std
::
string
&
name
);
void
AddPublicMemberAttributes
(
io
::
Printer
*
printer
);
void
SetCommonOneofFieldVariables
(
map
<
string
,
string
>*
variables
);
void
SetCommonOneofFieldVariables
(
std
::
map
<
string
,
string
>*
variables
);
std
::
string
oneof_property_name
();
std
::
string
oneof_name
();
...
...
@@ -89,7 +89,7 @@ class FieldGeneratorBase : public SourceGeneratorBase {
std
::
string
capitalized_type_name
();
private
:
void
SetCommonFieldVariables
(
map
<
string
,
string
>*
variables
);
void
SetCommonFieldVariables
(
std
::
map
<
string
,
string
>*
variables
);
std
::
string
GetStringDefaultValueInternal
();
std
::
string
GetBytesDefaultValueInternal
();
...
...
src/google/protobuf/compiler/csharp/csharp_message.cc
View file @
126082c3
...
...
@@ -105,7 +105,7 @@ void MessageGenerator::AddDeprecatedFlag(io::Printer* printer) {
}
void
MessageGenerator
::
Generate
(
io
::
Printer
*
printer
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"class_name"
]
=
class_name
();
vars
[
"access_level"
]
=
class_access_level
();
...
...
@@ -280,7 +280,7 @@ bool MessageGenerator::HasNestedGeneratedTypes()
}
void
MessageGenerator
::
GenerateCloningCode
(
io
::
Printer
*
printer
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
WriteGeneratedCodeAttributes
(
printer
);
vars
[
"class_name"
]
=
class_name
();
printer
->
Print
(
...
...
@@ -333,7 +333,7 @@ void MessageGenerator::GenerateFreezingCode(io::Printer* printer) {
}
void
MessageGenerator
::
GenerateFrameworkMethods
(
io
::
Printer
*
printer
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"class_name"
]
=
class_name
();
// Equality
...
...
@@ -432,7 +432,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
// Note: These are separate from GenerateMessageSerializationMethods()
// because they need to be generated even for messages that are optimized
// for code size.
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"class_name"
]
=
class_name
();
WriteGeneratedCodeAttributes
(
printer
);
...
...
src/google/protobuf/compiler/javanano/javanano_enum_field.cc
View file @
126082c3
...
...
@@ -52,7 +52,7 @@ namespace {
// TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of
// repeat code between this and the other field types.
void
SetEnumVariables
(
const
Params
&
params
,
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
const
FieldDescriptor
*
descriptor
,
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"name"
]
=
RenameJavaKeywords
(
UnderscoresToCamelCase
(
descriptor
));
(
*
variables
)[
"capitalized_name"
]
=
...
...
src/google/protobuf/compiler/javanano/javanano_enum_field.h
View file @
126082c3
...
...
@@ -62,7 +62,7 @@ class EnumFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
vector
<
string
>
canonical_values_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
EnumFieldGenerator
);
...
...
@@ -85,7 +85,7 @@ class AccessorEnumFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
vector
<
string
>
canonical_values_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
AccessorEnumFieldGenerator
);
...
...
@@ -112,7 +112,7 @@ class RepeatedEnumFieldGenerator : public FieldGenerator {
void
GenerateRepeatedDataSizeCode
(
io
::
Printer
*
printer
)
const
;
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
vector
<
string
>
canonical_values_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
RepeatedEnumFieldGenerator
);
...
...
src/google/protobuf/compiler/javanano/javanano_extension.cc
View file @
126082c3
...
...
@@ -78,7 +78,7 @@ const char* GetTypeConstantName(const FieldDescriptor::Type type) {
}
// namespace
void
SetVariables
(
const
FieldDescriptor
*
descriptor
,
const
Params
params
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"extends"
]
=
ClassName
(
params
,
descriptor
->
containing_type
());
(
*
variables
)[
"name"
]
=
RenameJavaKeywords
(
UnderscoresToCamelCase
(
descriptor
));
bool
repeated
=
descriptor
->
is_repeated
();
...
...
src/google/protobuf/compiler/javanano/javanano_extension.h
View file @
126082c3
...
...
@@ -61,7 +61,7 @@ class ExtensionGenerator {
private
:
const
Params
&
params_
;
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
ExtensionGenerator
);
};
...
...
src/google/protobuf/compiler/javanano/javanano_field.cc
View file @
126082c3
...
...
@@ -151,7 +151,7 @@ const FieldGenerator& FieldGeneratorMap::get(
}
void
SetCommonOneofVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"oneof_name"
]
=
UnderscoresToCamelCase
(
descriptor
->
containing_oneof
());
(
*
variables
)[
"oneof_capitalized_name"
]
=
...
...
@@ -169,7 +169,7 @@ void SetCommonOneofVariables(const FieldDescriptor* descriptor,
}
void
GenerateOneofFieldEquals
(
const
FieldDescriptor
*
descriptor
,
const
map
<
string
,
string
>&
variables
,
const
std
::
map
<
string
,
string
>&
variables
,
io
::
Printer
*
printer
)
{
if
(
GetJavaType
(
descriptor
)
==
JAVATYPE_BYTES
)
{
printer
->
Print
(
variables
,
...
...
@@ -190,7 +190,7 @@ void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
}
void
GenerateOneofFieldHashCode
(
const
FieldDescriptor
*
descriptor
,
const
map
<
string
,
string
>&
variables
,
const
std
::
map
<
string
,
string
>&
variables
,
io
::
Printer
*
printer
)
{
if
(
GetJavaType
(
descriptor
)
==
JAVATYPE_BYTES
)
{
printer
->
Print
(
variables
,
...
...
src/google/protobuf/compiler/javanano/javanano_field.h
View file @
126082c3
...
...
@@ -114,12 +114,12 @@ class FieldGeneratorMap {
};
void
SetCommonOneofVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
);
std
::
map
<
string
,
string
>*
variables
);
void
GenerateOneofFieldEquals
(
const
FieldDescriptor
*
descriptor
,
const
map
<
string
,
string
>&
variables
,
const
std
::
map
<
string
,
string
>&
variables
,
io
::
Printer
*
printer
);
void
GenerateOneofFieldHashCode
(
const
FieldDescriptor
*
descriptor
,
const
map
<
string
,
string
>&
variables
,
const
std
::
map
<
string
,
string
>&
variables
,
io
::
Printer
*
printer
);
}
// namespace javanano
...
...
src/google/protobuf/compiler/javanano/javanano_helpers.cc
View file @
126082c3
...
...
@@ -567,7 +567,7 @@ string GenerateDifferentBit(int bit_index) {
}
void
SetBitOperationVariables
(
const
string
name
,
int
bitIndex
,
map
<
string
,
string
>*
variables
)
{
int
bitIndex
,
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"get_"
+
name
]
=
GenerateGetBit
(
bitIndex
);
(
*
variables
)[
"set_"
+
name
]
=
GenerateSetBit
(
bitIndex
);
(
*
variables
)[
"clear_"
+
name
]
=
GenerateClearBit
(
bitIndex
);
...
...
src/google/protobuf/compiler/javanano/javanano_helpers.h
View file @
126082c3
...
...
@@ -181,7 +181,7 @@ string GenerateDifferentBit(int bit_index);
// the given name of the bit, to the appropriate Java expressions for the given
// bit index.
void
SetBitOperationVariables
(
const
string
name
,
int
bitIndex
,
map
<
string
,
string
>*
variables
);
int
bitIndex
,
std
::
map
<
string
,
string
>*
variables
);
inline
bool
IsMapEntry
(
const
Descriptor
*
descriptor
)
{
// TODO(liujisi): Add an option to turn on maps for proto2 syntax as well.
...
...
src/google/protobuf/compiler/javanano/javanano_map_field.cc
View file @
126082c3
...
...
@@ -84,7 +84,7 @@ const FieldDescriptor* ValueField(const FieldDescriptor* descriptor) {
}
void
SetMapVariables
(
const
Params
&
params
,
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
const
FieldDescriptor
*
descriptor
,
std
::
map
<
string
,
string
>*
variables
)
{
const
FieldDescriptor
*
key
=
KeyField
(
descriptor
);
const
FieldDescriptor
*
value
=
ValueField
(
descriptor
);
(
*
variables
)[
"name"
]
=
...
...
src/google/protobuf/compiler/javanano/javanano_map_field.h
View file @
126082c3
...
...
@@ -58,7 +58,7 @@ class MapFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
MapFieldGenerator
);
};
...
...
src/google/protobuf/compiler/javanano/javanano_message.cc
View file @
126082c3
...
...
@@ -182,7 +182,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
}
// oneof
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"message_name"
]
=
descriptor_
->
name
();
for
(
int
i
=
0
;
i
<
descriptor_
->
oneof_decl_count
();
i
++
)
{
const
OneofDescriptor
*
oneof_desc
=
descriptor_
->
oneof_decl
(
i
);
...
...
src/google/protobuf/compiler/javanano/javanano_message_field.cc
View file @
126082c3
...
...
@@ -54,7 +54,7 @@ namespace {
// TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of
// repeat code between this and the other field types.
void
SetMessageVariables
(
const
Params
&
params
,
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
const
FieldDescriptor
*
descriptor
,
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"name"
]
=
RenameJavaKeywords
(
UnderscoresToCamelCase
(
descriptor
));
(
*
variables
)[
"capitalized_name"
]
=
...
...
src/google/protobuf/compiler/javanano/javanano_message_field.h
View file @
126082c3
...
...
@@ -62,7 +62,7 @@ class MessageFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
MessageFieldGenerator
);
};
...
...
@@ -85,7 +85,7 @@ class MessageOneofFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
MessageOneofFieldGenerator
);
};
...
...
@@ -108,7 +108,7 @@ class RepeatedMessageFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
RepeatedMessageFieldGenerator
);
};
...
...
src/google/protobuf/compiler/javanano/javanano_params.h
View file @
126082c3
...
...
@@ -47,8 +47,8 @@ enum eMultipleFiles { JAVANANO_MUL_UNSET, JAVANANO_MUL_FALSE, JAVANANO_MUL_TRUE
// Parameters for used by the generators
class
Params
{
public
:
typedef
map
<
string
,
string
>
NameMap
;
typedef
set
<
string
>
NameSet
;
typedef
std
::
map
<
string
,
string
>
NameMap
;
typedef
s
td
::
s
et
<
string
>
NameSet
;
private
:
string
empty_
;
string
base_name_
;
...
...
src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
View file @
126082c3
...
...
@@ -166,7 +166,7 @@ bool AllAscii(const string& text) {
void
SetPrimitiveVariables
(
const
FieldDescriptor
*
descriptor
,
const
Params
params
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
(
*
variables
)[
"name"
]
=
RenameJavaKeywords
(
UnderscoresToCamelCase
(
descriptor
));
(
*
variables
)[
"capitalized_name"
]
=
...
...
src/google/protobuf/compiler/javanano/javanano_primitive_field.h
View file @
126082c3
...
...
@@ -65,7 +65,7 @@ class PrimitiveFieldGenerator : public FieldGenerator {
void
GenerateSerializationConditional
(
io
::
Printer
*
printer
)
const
;
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
PrimitiveFieldGenerator
);
};
...
...
@@ -89,7 +89,7 @@ class AccessorPrimitiveFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
AccessorPrimitiveFieldGenerator
);
};
...
...
@@ -111,7 +111,7 @@ class PrimitiveOneofFieldGenerator : public FieldGenerator {
private
:
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
PrimitiveOneofFieldGenerator
);
};
...
...
@@ -137,7 +137,7 @@ class RepeatedPrimitiveFieldGenerator : public FieldGenerator {
void
GenerateRepeatedDataSizeCode
(
io
::
Printer
*
printer
)
const
;
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
RepeatedPrimitiveFieldGenerator
);
};
...
...
src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
View file @
126082c3
...
...
@@ -46,7 +46,7 @@ namespace objectivec {
namespace
{
void
SetEnumVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
string
type
=
EnumName
(
descriptor
->
enum_type
());
(
*
variables
)[
"storage_type"
]
=
type
;
// For non repeated fields, if it was defined in a different file, the
...
...
@@ -118,7 +118,7 @@ void EnumFieldGenerator::GenerateCFunctionImplementations(
}
void
EnumFieldGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
{
s
td
::
s
et
<
string
>*
fwd_decls
)
const
{
SingleFieldGenerator
::
DetermineForwardDeclarations
(
fwd_decls
);
// If it is an enum defined in a different file, then we'll need a forward
// declaration for it. When it is in our file, all the enums are output
...
...
src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
View file @
126082c3
...
...
@@ -47,7 +47,7 @@ class EnumFieldGenerator : public SingleFieldGenerator {
public
:
virtual
void
GenerateCFunctionDeclarations
(
io
::
Printer
*
printer
)
const
;
virtual
void
GenerateCFunctionImplementations
(
io
::
Printer
*
printer
)
const
;
virtual
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
;
virtual
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
const
;
protected
:
EnumFieldGenerator
(
const
FieldDescriptor
*
descriptor
,
const
Options
&
options
);
...
...
src/google/protobuf/compiler/objectivec/objectivec_extension.cc
View file @
126082c3
...
...
@@ -59,7 +59,7 @@ ExtensionGenerator::ExtensionGenerator(const string& root_class_name,
ExtensionGenerator
::~
ExtensionGenerator
()
{}
void
ExtensionGenerator
::
GenerateMembersHeader
(
io
::
Printer
*
printer
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"method_name"
]
=
method_name_
;
SourceLocation
location
;
if
(
descriptor_
->
GetSourceLocation
(
&
location
))
{
...
...
@@ -77,7 +77,7 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
void
ExtensionGenerator
::
GenerateStaticVariablesInitialization
(
io
::
Printer
*
printer
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"root_class_and_method_name"
]
=
root_class_and_method_name_
;
vars
[
"extended_type"
]
=
ClassName
(
descriptor_
->
containing_type
());
vars
[
"number"
]
=
SimpleItoa
(
descriptor_
->
number
());
...
...
src/google/protobuf/compiler/objectivec/objectivec_field.cc
View file @
126082c3
...
...
@@ -49,7 +49,7 @@ namespace objectivec {
namespace
{
void
SetCommonFieldVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
string
camel_case_name
=
FieldName
(
descriptor
);
string
raw_field_name
;
if
(
descriptor
->
type
()
==
FieldDescriptor
::
TYPE_GROUP
)
{
...
...
@@ -178,7 +178,7 @@ void FieldGenerator::GenerateCFunctionImplementations(
}
void
FieldGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
{
s
td
::
s
et
<
string
>*
fwd_decls
)
const
{
// Nothing
}
...
...
src/google/protobuf/compiler/objectivec/objectivec_field.h
View file @
126082c3
...
...
@@ -67,7 +67,7 @@ class FieldGenerator {
virtual
void
GenerateCFunctionImplementations
(
io
::
Printer
*
printer
)
const
;
// Exposed for subclasses, should always call it on the parent class also.
virtual
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
;
virtual
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
const
;
// Used during generation, not intended to be extended by subclasses.
void
GenerateFieldDescription
(
...
...
@@ -100,7 +100,7 @@ class FieldGenerator {
virtual
bool
WantsHasProperty
(
void
)
const
=
0
;
const
FieldDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
private
:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
FieldGenerator
);
...
...
src/google/protobuf/compiler/objectivec/objectivec_file.cc
View file @
126082c3
...
...
@@ -89,7 +89,7 @@ bool FileContainsExtensions(const FileDescriptor* file) {
void
PruneFileAndDepsMarkingAsVisited
(
const
FileDescriptor
*
file
,
vector
<
const
FileDescriptor
*>*
files
,
set
<
const
FileDescriptor
*>*
files_visited
)
{
s
td
::
s
et
<
const
FileDescriptor
*>*
files_visited
)
{
vector
<
const
FileDescriptor
*>::
iterator
iter
=
std
::
find
(
files
->
begin
(),
files
->
end
(),
file
);
if
(
iter
!=
files
->
end
())
{
...
...
@@ -105,7 +105,7 @@ void PruneFileAndDepsMarkingAsVisited(
void
CollectMinimalFileDepsContainingExtensionsWorker
(
const
FileDescriptor
*
file
,
vector
<
const
FileDescriptor
*>*
files
,
set
<
const
FileDescriptor
*>*
files_visited
)
{
s
td
::
s
et
<
const
FileDescriptor
*>*
files_visited
)
{
if
(
files_visited
->
find
(
file
)
!=
files_visited
->
end
())
{
return
;
}
...
...
@@ -138,7 +138,7 @@ void CollectMinimalFileDepsContainingExtensionsWorker(
void
CollectMinimalFileDepsContainingExtensions
(
const
FileDescriptor
*
file
,
vector
<
const
FileDescriptor
*>*
files
)
{
set
<
const
FileDescriptor
*>
files_visited
;
s
td
::
s
et
<
const
FileDescriptor
*>
files_visited
;
for
(
int
i
=
0
;
i
<
file
->
dependency_count
();
i
++
)
{
const
FileDescriptor
*
dep
=
file
->
dependency
(
i
);
CollectMinimalFileDepsContainingExtensionsWorker
(
dep
,
files
,
...
...
@@ -229,12 +229,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"CF_EXTERN_C_BEGIN
\n
"
"
\n
"
);
set
<
string
>
fwd_decls
;
s
td
::
s
et
<
string
>
fwd_decls
;
for
(
vector
<
MessageGenerator
*>::
iterator
iter
=
message_generators_
.
begin
();
iter
!=
message_generators_
.
end
();
++
iter
)
{
(
*
iter
)
->
DetermineForwardDeclarations
(
&
fwd_decls
);
}
for
(
set
<
string
>::
const_iterator
i
(
fwd_decls
.
begin
());
for
(
s
td
::
s
et
<
string
>::
const_iterator
i
(
fwd_decls
.
begin
());
i
!=
fwd_decls
.
end
();
++
i
)
{
printer
->
Print
(
"$value$;
\n
"
,
"value"
,
*
i
);
}
...
...
@@ -325,7 +325,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// #import the headers for anything that a plain dependency of this proto
// file (that means they were just an include, not a "public" include).
set
<
string
>
public_import_names
;
s
td
::
s
et
<
string
>
public_import_names
;
for
(
int
i
=
0
;
i
<
file_
->
public_dependency_count
();
i
++
)
{
public_import_names
.
insert
(
file_
->
public_dependency
(
i
)
->
name
());
}
...
...
@@ -468,7 +468,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// File descriptor only needed if there are messages to use it.
if
(
message_generators_
.
size
()
>
0
)
{
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"root_class_name"
]
=
root_class_name_
;
vars
[
"package"
]
=
file_
->
package
();
vars
[
"objc_prefix"
]
=
FileClassPrefix
(
file_
);
...
...
src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
View file @
126082c3
...
...
@@ -980,13 +980,13 @@ namespace {
class
ExpectedPrefixesCollector
:
public
LineConsumer
{
public
:
ExpectedPrefixesCollector
(
map
<
string
,
string
>*
inout_package_to_prefix_map
)
ExpectedPrefixesCollector
(
std
::
map
<
string
,
string
>*
inout_package_to_prefix_map
)
:
prefix_map_
(
inout_package_to_prefix_map
)
{}
virtual
bool
ConsumeLine
(
const
StringPiece
&
line
,
string
*
out_error
);
private
:
map
<
string
,
string
>*
prefix_map_
;
std
::
map
<
string
,
string
>*
prefix_map_
;
};
bool
ExpectedPrefixesCollector
::
ConsumeLine
(
...
...
@@ -1009,7 +1009,7 @@ bool ExpectedPrefixesCollector::ConsumeLine(
}
bool
LoadExpectedPackagePrefixes
(
const
Options
&
generation_options
,
map
<
string
,
string
>*
prefix_map
,
std
::
map
<
string
,
string
>*
prefix_map
,
string
*
out_error
)
{
if
(
generation_options
.
expected_prefixes_path
.
empty
())
{
return
true
;
...
...
@@ -1023,7 +1023,7 @@ bool LoadExpectedPackagePrefixes(const Options &generation_options,
bool
ValidateObjCClassPrefix
(
const
FileDescriptor
*
file
,
const
string
&
expected_prefixes_path
,
const
map
<
string
,
string
>&
expected_package_prefixes
,
const
std
::
map
<
string
,
string
>&
expected_package_prefixes
,
string
*
out_error
)
{
const
string
prefix
=
file
->
options
().
objc_class_prefix
();
const
string
package
=
file
->
package
();
...
...
@@ -1033,7 +1033,7 @@ bool ValidateObjCClassPrefix(
// Check: Error - See if there was an expected prefix for the package and
// report if it doesn't match (wrong or missing).
map
<
string
,
string
>::
const_iterator
package_match
=
std
::
map
<
string
,
string
>::
const_iterator
package_match
=
expected_package_prefixes
.
find
(
package
);
if
(
package_match
!=
expected_package_prefixes
.
end
())
{
// There was an entry, and...
...
...
@@ -1082,7 +1082,7 @@ bool ValidateObjCClassPrefix(
// Look for any other package that uses the same prefix.
string
other_package_for_prefix
;
for
(
map
<
string
,
string
>::
const_iterator
i
=
expected_package_prefixes
.
begin
();
for
(
std
::
map
<
string
,
string
>::
const_iterator
i
=
expected_package_prefixes
.
begin
();
i
!=
expected_package_prefixes
.
end
();
++
i
)
{
if
(
i
->
second
==
prefix
)
{
other_package_for_prefix
=
i
->
first
;
...
...
@@ -1150,7 +1150,7 @@ bool ValidateObjCClassPrefixes(const vector<const FileDescriptor*>& files,
const
Options
&
generation_options
,
string
*
out_error
)
{
// Load the expected package prefixes, if available, to validate against.
map
<
string
,
string
>
expected_package_prefixes
;
std
::
map
<
string
,
string
>
expected_package_prefixes
;
if
(
!
LoadExpectedPackagePrefixes
(
generation_options
,
&
expected_package_prefixes
,
out_error
))
{
...
...
@@ -1519,7 +1519,7 @@ void ImportWriter::AddFile(const FileDescriptor* file,
ParseFrameworkMappings
();
}
map
<
string
,
string
>::
iterator
proto_lookup
=
std
::
map
<
string
,
string
>::
iterator
proto_lookup
=
proto_file_to_framework_name_
.
find
(
file
->
name
());
if
(
proto_lookup
!=
proto_file_to_framework_name_
.
end
())
{
other_framework_imports_
.
push_back
(
...
...
@@ -1640,7 +1640,7 @@ bool ImportWriter::ProtoFrameworkCollector::ConsumeLine(
StringPiece
proto_file
(
proto_file_list
,
start
,
offset
-
start
);
StringPieceTrimWhitespace
(
&
proto_file
);
if
(
proto_file
.
size
()
!=
0
)
{
map
<
string
,
string
>::
iterator
existing_entry
=
std
::
map
<
string
,
string
>::
iterator
existing_entry
=
map_
->
find
(
proto_file
.
ToString
());
if
(
existing_entry
!=
map_
->
end
())
{
std
::
cerr
<<
"warning: duplicate proto file reference, replacing framework entry for '"
...
...
src/google/protobuf/compiler/objectivec/objectivec_helpers.h
View file @
126082c3
...
...
@@ -262,20 +262,20 @@ class LIBPROTOC_EXPORT ImportWriter {
private
:
class
ProtoFrameworkCollector
:
public
LineConsumer
{
public
:
ProtoFrameworkCollector
(
map
<
string
,
string
>*
inout_proto_file_to_framework_name
)
ProtoFrameworkCollector
(
std
::
map
<
string
,
string
>*
inout_proto_file_to_framework_name
)
:
map_
(
inout_proto_file_to_framework_name
)
{}
virtual
bool
ConsumeLine
(
const
StringPiece
&
line
,
string
*
out_error
);
private
:
map
<
string
,
string
>*
map_
;
std
::
map
<
string
,
string
>*
map_
;
};
void
ParseFrameworkMappings
();
const
string
generate_for_named_framework_
;
const
string
named_framework_to_proto_path_mappings_path_
;
map
<
string
,
string
>
proto_file_to_framework_name_
;
std
::
map
<
string
,
string
>
proto_file_to_framework_name_
;
bool
need_to_parse_mapping_file_
;
vector
<
string
>
protobuf_framework_imports_
;
...
...
src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
View file @
126082c3
...
...
@@ -162,7 +162,7 @@ void MapFieldGenerator::FinishInitialization(void) {
}
void
MapFieldGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
{
s
td
::
s
et
<
string
>*
fwd_decls
)
const
{
RepeatedFieldGenerator
::
DetermineForwardDeclarations
(
fwd_decls
);
const
FieldDescriptor
*
value_descriptor
=
descriptor_
->
message_type
()
->
FindFieldByName
(
"value"
);
...
...
src/google/protobuf/compiler/objectivec/objectivec_map_field.h
View file @
126082c3
...
...
@@ -51,7 +51,7 @@ class MapFieldGenerator : public RepeatedFieldGenerator {
MapFieldGenerator
(
const
FieldDescriptor
*
descriptor
,
const
Options
&
options
);
virtual
~
MapFieldGenerator
();
virtual
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
;
virtual
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
const
;
private
:
scoped_ptr
<
FieldGenerator
>
value_field_generator_
;
...
...
src/google/protobuf/compiler/objectivec/objectivec_message.cc
View file @
126082c3
...
...
@@ -233,7 +233,7 @@ void MessageGenerator::GenerateStaticVariablesInitialization(
}
}
void
MessageGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
{
void
MessageGenerator
::
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
{
if
(
!
IsMapEntryMessage
(
descriptor_
))
{
for
(
int
i
=
0
;
i
<
descriptor_
->
field_count
();
i
++
)
{
const
FieldDescriptor
*
fieldDescriptor
=
descriptor_
->
field
(
i
);
...
...
@@ -514,7 +514,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
" };
\n
"
);
}
map
<
string
,
string
>
vars
;
std
::
map
<
string
,
string
>
vars
;
vars
[
"classname"
]
=
class_name_
;
vars
[
"rootclassname"
]
=
root_classname_
;
vars
[
"fields"
]
=
has_fields
?
"fields"
:
"NULL"
;
...
...
src/google/protobuf/compiler/objectivec/objectivec_message.h
View file @
126082c3
...
...
@@ -64,7 +64,7 @@ class MessageGenerator {
void
GenerateMessageHeader
(
io
::
Printer
*
printer
);
void
GenerateSource
(
io
::
Printer
*
printer
);
void
GenerateExtensionRegistrationSource
(
io
::
Printer
*
printer
);
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
);
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
);
// Checks if the message or a nested message includes a oneof definition.
bool
IncludesOneOfDefinition
()
const
;
...
...
src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
View file @
126082c3
...
...
@@ -45,7 +45,7 @@ namespace objectivec {
namespace
{
void
SetMessageVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
const
string
&
message_type
=
ClassName
(
descriptor
->
message_type
());
(
*
variables
)[
"type"
]
=
message_type
;
(
*
variables
)[
"containing_class"
]
=
ClassName
(
descriptor
->
containing_type
());
...
...
@@ -67,7 +67,7 @@ MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor,
MessageFieldGenerator
::~
MessageFieldGenerator
()
{}
void
MessageFieldGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
{
s
td
::
s
et
<
string
>*
fwd_decls
)
const
{
ObjCObjFieldGenerator
::
DetermineForwardDeclarations
(
fwd_decls
);
// Class name is already in "storage_type".
fwd_decls
->
insert
(
"@class "
+
variable
(
"storage_type"
));
...
...
@@ -95,7 +95,7 @@ RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator(
RepeatedMessageFieldGenerator
::~
RepeatedMessageFieldGenerator
()
{}
void
RepeatedMessageFieldGenerator
::
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
{
s
td
::
s
et
<
string
>*
fwd_decls
)
const
{
RepeatedFieldGenerator
::
DetermineForwardDeclarations
(
fwd_decls
);
// Class name is already in "storage_type".
fwd_decls
->
insert
(
"@class "
+
variable
(
"storage_type"
));
...
...
src/google/protobuf/compiler/objectivec/objectivec_message_field.h
View file @
126082c3
...
...
@@ -51,7 +51,7 @@ class MessageFieldGenerator : public ObjCObjFieldGenerator {
virtual
bool
WantsHasProperty
(
void
)
const
;
public
:
virtual
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
;
virtual
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
const
;
private
:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
MessageFieldGenerator
);
...
...
@@ -67,7 +67,7 @@ class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
virtual
~
RepeatedMessageFieldGenerator
();
public
:
virtual
void
DetermineForwardDeclarations
(
set
<
string
>*
fwd_decls
)
const
;
virtual
void
DetermineForwardDeclarations
(
s
td
::
s
et
<
string
>*
fwd_decls
)
const
;
private
:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
RepeatedMessageFieldGenerator
);
...
...
src/google/protobuf/compiler/objectivec/objectivec_oneof.h
View file @
126082c3
...
...
@@ -67,7 +67,7 @@ class OneofGenerator {
private
:
const
OneofDescriptor
*
descriptor_
;
map
<
string
,
string
>
variables_
;
std
::
map
<
string
,
string
>
variables_
;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
(
OneofGenerator
);
};
...
...
src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
View file @
126082c3
...
...
@@ -118,7 +118,7 @@ const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) {
}
void
SetPrimitiveVariables
(
const
FieldDescriptor
*
descriptor
,
map
<
string
,
string
>*
variables
)
{
std
::
map
<
string
,
string
>*
variables
)
{
std
::
string
primitive_name
=
PrimitiveTypeName
(
descriptor
);
(
*
variables
)[
"type"
]
=
primitive_name
;
(
*
variables
)[
"storage_type"
]
=
primitive_name
;
...
...
src/google/protobuf/stubs/common.h
View file @
126082c3
...
...
@@ -227,10 +227,8 @@ class FatalException : public std::exception {
// in some versions of MSVC.
// TODO(acozzette): remove these using statements
using
std
::
istream
;
using
std
::
map
;
using
std
::
ostream
;
using
std
::
pair
;
using
std
::
set
;
using
std
::
string
;
using
std
::
vector
;
...
...
src/google/protobuf/testing/googletest.h
View file @
126082c3
...
...
@@ -85,7 +85,7 @@ class ScopedMemoryLog {
const
vector
<
string
>&
GetMessages
(
LogLevel
error
);
private
:
map
<
LogLevel
,
vector
<
string
>
>
messages_
;
std
::
map
<
LogLevel
,
vector
<
string
>
>
messages_
;
LogHandler
*
old_handler_
;
static
void
HandleLog
(
LogLevel
level
,
const
char
*
filename
,
int
line
,
...
...
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