Skip to content

Commit c4642f8

Browse files
compile: add std:: to all stl types
1 parent 527d243 commit c4642f8

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

compiler/src/java_plugin/cpp/java_generator.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ static void GrpcSplitStringToIteratorUsing(const string& full,
133133
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
134134
static void GrpcSplitStringUsing(const string& full,
135135
const char* delim,
136-
vector<string>* result) {
137-
std::back_insert_iterator< vector<string> > it(*result);
136+
std::vector<string>* result) {
137+
std::back_insert_iterator< std::vector<string> > it(*result);
138138
GrpcSplitStringToIteratorUsing(full, delim, it);
139139
}
140140

141141
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
142-
static vector<string> GrpcSplit(const string& full, const char* delim) {
143-
vector<string> result;
142+
static std::vector<string> GrpcSplit(const string& full, const char* delim) {
143+
std::vector<string> result;
144144
GrpcSplitStringUsing(full, delim, &result);
145145
return result;
146146
}
@@ -216,7 +216,7 @@ static string GrpcGetCommentsForDescriptor(const DescriptorType* descriptor) {
216216
}
217217

218218
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
219-
static vector<string> GrpcGetDocLines(const string& comments) {
219+
static std::vector<string> GrpcGetDocLines(const string& comments) {
220220
if (!comments.empty()) {
221221
// TODO(kenton): Ideally we should parse the comment text as Markdown and
222222
// write it back as HTML, but this requires a Markdown parser. For now
@@ -226,24 +226,24 @@ static vector<string> GrpcGetDocLines(const string& comments) {
226226
// HTML-escape them so that they don't accidentally close the doc comment.
227227
string escapedComments = GrpcEscapeJavadoc(comments);
228228

229-
vector<string> lines = GrpcSplit(escapedComments, "\n");
229+
std::vector<string> lines = GrpcSplit(escapedComments, "\n");
230230
while (!lines.empty() && lines.back().empty()) {
231231
lines.pop_back();
232232
}
233233
return lines;
234234
}
235-
return vector<string>();
235+
return std::vector<string>();
236236
}
237237

238238
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
239239
template <typename DescriptorType>
240-
static vector<string> GrpcGetDocLinesForDescriptor(const DescriptorType* descriptor) {
240+
static std::vector<string> GrpcGetDocLinesForDescriptor(const DescriptorType* descriptor) {
241241
return GrpcGetDocLines(GrpcGetCommentsForDescriptor(descriptor));
242242
}
243243

244244
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
245245
static void GrpcWriteDocCommentBody(Printer* printer,
246-
const vector<string>& lines,
246+
const std::vector<string>& lines,
247247
bool surroundWithPreTag) {
248248
if (!lines.empty()) {
249249
if (surroundWithPreTag) {
@@ -270,7 +270,7 @@ static void GrpcWriteDocCommentBody(Printer* printer,
270270
// TODO(nmittler): Remove once protobuf includes javadoc methods in distribution.
271271
static void GrpcWriteDocComment(Printer* printer, const string& comments) {
272272
printer->Print("/**\n");
273-
vector<string> lines = GrpcGetDocLines(comments);
273+
std::vector<string> lines = GrpcGetDocLines(comments);
274274
GrpcWriteDocCommentBody(printer, lines, false);
275275
printer->Print(" */\n");
276276
}
@@ -281,7 +281,7 @@ static void GrpcWriteServiceDocComment(Printer* printer,
281281
// Deviating from protobuf to avoid extraneous docs
282282
// (see https://github.com/google/protobuf/issues/1406);
283283
printer->Print("/**\n");
284-
vector<string> lines = GrpcGetDocLinesForDescriptor(service);
284+
std::vector<string> lines = GrpcGetDocLinesForDescriptor(service);
285285
GrpcWriteDocCommentBody(printer, lines, true);
286286
printer->Print(" */\n");
287287
}
@@ -292,14 +292,14 @@ void GrpcWriteMethodDocComment(Printer* printer,
292292
// Deviating from protobuf to avoid extraneous docs
293293
// (see https://github.com/google/protobuf/issues/1406);
294294
printer->Print("/**\n");
295-
vector<string> lines = GrpcGetDocLinesForDescriptor(method);
295+
std::vector<string> lines = GrpcGetDocLinesForDescriptor(method);
296296
GrpcWriteDocCommentBody(printer, lines, true);
297297
printer->Print(" */\n");
298298
}
299299

300300
static void PrintMethodFields(
301-
const ServiceDescriptor* service, map<string, string>* vars, Printer* p,
302-
ProtoFlavor flavor) {
301+
const ServiceDescriptor* service, std::map<string, string>* vars,
302+
Printer* p, ProtoFlavor flavor) {
303303
p->Print("// Static method descriptors that strictly reflect the proto.\n");
304304
(*vars)["service_name"] = service->name();
305305
for (int i = 0; i < service->method_count(); ++i) {
@@ -432,12 +432,12 @@ enum CallType {
432432
};
433433

434434
static void PrintBindServiceMethodBody(const ServiceDescriptor* service,
435-
map<string, string>* vars,
435+
std::map<string, string>* vars,
436436
Printer* p,
437437
bool generate_nano);
438438

439439
static void PrintDeprecatedDocComment(const ServiceDescriptor* service,
440-
map<string, string>* vars,
440+
std::map<string, string>* vars,
441441
Printer* p) {
442442
p->Print(
443443
*vars,
@@ -470,7 +470,7 @@ static void PrintDeprecatedDocComment(const ServiceDescriptor* service,
470470
// Prints a client interface or implementation class, or a server interface.
471471
static void PrintStub(
472472
const ServiceDescriptor* service,
473-
map<string, string>* vars,
473+
std::map<string, string>* vars,
474474
Printer* p, StubType type, bool generate_nano,
475475
bool enable_deprecated) {
476476
const string service_name = service->name();
@@ -766,12 +766,12 @@ static bool CompareMethodClientStreaming(const MethodDescriptor* method1,
766766
// Place all method invocations into a single class to reduce memory footprint
767767
// on Android.
768768
static void PrintMethodHandlerClass(const ServiceDescriptor* service,
769-
map<string, string>* vars,
769+
std::map<string, string>* vars,
770770
Printer* p,
771771
bool generate_nano,
772772
bool enable_deprecated) {
773773
// Sort method ids based on client_streaming() so switch tables are compact.
774-
vector<const MethodDescriptor*> sorted_methods(service->method_count());
774+
std::vector<const MethodDescriptor*> sorted_methods(service->method_count());
775775
for (int i = 0; i < service->method_count(); ++i) {
776776
sorted_methods[i] = service->method(i);
777777
}
@@ -882,7 +882,7 @@ static void PrintMethodHandlerClass(const ServiceDescriptor* service,
882882
}
883883

884884
static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service,
885-
map<string, string>* vars,
885+
std::map<string, string>* vars,
886886
Printer* p,
887887
ProtoFlavor flavor) {
888888
(*vars)["service_name"] = service->name();
@@ -960,7 +960,7 @@ static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service,
960960
}
961961

962962
static void PrintBindServiceMethodBody(const ServiceDescriptor* service,
963-
map<string, string>* vars,
963+
std::map<string, string>* vars,
964964
Printer* p,
965965
bool generate_nano) {
966966
(*vars)["service_name"] = service->name();
@@ -1017,7 +1017,7 @@ static void PrintBindServiceMethodBody(const ServiceDescriptor* service,
10171017
}
10181018

10191019
static void PrintService(const ServiceDescriptor* service,
1020-
map<string, string>* vars,
1020+
std::map<string, string>* vars,
10211021
Printer* p,
10221022
ProtoFlavor flavor,
10231023
bool enable_deprecated) {
@@ -1168,7 +1168,7 @@ void GenerateService(const ServiceDescriptor* service,
11681168
bool enable_deprecated) {
11691169
// All non-generated classes must be referred by fully qualified names to
11701170
// avoid collision with generated classes.
1171-
map<string, string> vars;
1171+
std::map<string, string> vars;
11721172
vars["String"] = "java.lang.String";
11731173
vars["Override"] = "java.lang.Override";
11741174
vars["Deprecated"] = "java.lang.Deprecated";

compiler/src/java_plugin/cpp/java_plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
3131
const string& parameter,
3232
google::protobuf::compiler::GeneratorContext* context,
3333
string* error) const {
34-
vector<pair<string, string> > options;
34+
std::vector<std::pair<string, string> > options;
3535
google::protobuf::compiler::ParseGeneratorParameter(parameter, &options);
3636

3737
java_grpc_generator::ProtoFlavor flavor =

0 commit comments

Comments
 (0)