Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: third_party/protobuf/src/google/protobuf/io/printer.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/io/printer.cc
diff --git a/third_party/protobuf/src/google/protobuf/io/printer.cc b/third_party/protobuf/src/google/protobuf/io/printer.cc
index 7532b098bcf64de322a77aa25d102d4c271178da..99e895f588366c651f01c9c292d3754e62c066e2 100644
--- a/third_party/protobuf/src/google/protobuf/io/printer.cc
+++ b/third_party/protobuf/src/google/protobuf/io/printer.cc
@@ -70,8 +70,8 @@ Printer::~Printer() {
}
bool Printer::GetSubstitutionRange(const char* varname,
- pair<size_t, size_t>* range) {
- map<string, pair<size_t, size_t> >::const_iterator iter =
+ std::pair<size_t, size_t>* range) {
+ std::map<string, std::pair<size_t, size_t> >::const_iterator iter =
substitutions_.find(varname);
if (iter == substitutions_.end()) {
GOOGLE_LOG(DFATAL) << " Undefined variable in annotation: " << varname;
@@ -87,12 +87,12 @@ bool Printer::GetSubstitutionRange(const char* varname,
}
void Printer::Annotate(const char* begin_varname, const char* end_varname,
- const string& file_path, const vector<int>& path) {
+ const string& file_path, const std::vector<int>& path) {
if (annotation_collector_ == NULL) {
// Can't generate signatures with this Printer.
return;
}
- pair<size_t, size_t> begin, end;
+ std::pair<size_t, size_t> begin, end;
if (!GetSubstitutionRange(begin_varname, &begin) ||
!GetSubstitutionRange(end_varname, &end)) {
return;
@@ -106,7 +106,8 @@ void Printer::Annotate(const char* begin_varname, const char* end_varname,
}
}
-void Printer::Print(const map<string, string>& variables, const char* text) {
+void Printer::Print(const std::map<string, string>& variables,
+ const char* text) {
int size = strlen(text);
int pos = 0; // The number of bytes we've written so far.
substitutions_.clear();
@@ -143,14 +144,15 @@ void Printer::Print(const map<string, string>& variables, const char* text) {
WriteRaw(&variable_delimiter_, 1);
} else {
// Replace with the variable's value.
- map<string, string>::const_iterator iter = variables.find(varname);
+ std::map<string, string>::const_iterator iter = variables.find(varname);
if (iter == variables.end()) {
GOOGLE_LOG(DFATAL) << " Undefined variable: " << varname;
} else {
size_t begin = offset_;
WriteRaw(iter->second.data(), iter->second.size());
- pair<map<string, pair<size_t, size_t> >::iterator, bool> inserted =
- substitutions_.insert(
+ std::pair<std::map<string, std::pair<size_t, size_t> >::iterator,
+ bool>
+ inserted = substitutions_.insert(
std::make_pair(varname, std::make_pair(begin, offset_)));
if (!inserted.second) {
// This variable was used multiple times. Make its span have
@@ -172,13 +174,13 @@ void Printer::Print(const map<string, string>& variables, const char* text) {
}
void Printer::Print(const char* text) {
- static map<string, string> empty;
+ static std::map<string, string> empty;
Print(empty, text);
}
void Printer::Print(const char* text,
const char* variable, const string& value) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable] = value;
Print(vars, text);
}
@@ -186,7 +188,7 @@ void Printer::Print(const char* text,
void Printer::Print(const char* text,
const char* variable1, const string& value1,
const char* variable2, const string& value2) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
Print(vars, text);
@@ -196,7 +198,7 @@ void Printer::Print(const char* text,
const char* variable1, const string& value1,
const char* variable2, const string& value2,
const char* variable3, const string& value3) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
@@ -208,7 +210,7 @@ void Printer::Print(const char* text,
const char* variable2, const string& value2,
const char* variable3, const string& value3,
const char* variable4, const string& value4) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
@@ -222,7 +224,7 @@ void Printer::Print(const char* text,
const char* variable3, const string& value3,
const char* variable4, const string& value4,
const char* variable5, const string& value5) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
@@ -238,7 +240,7 @@ void Printer::Print(const char* text,
const char* variable4, const string& value4,
const char* variable5, const string& value5,
const char* variable6, const string& value6) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
@@ -256,7 +258,7 @@ void Printer::Print(const char* text,
const char* variable5, const string& value5,
const char* variable6, const string& value6,
const char* variable7, const string& value7) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
@@ -276,7 +278,7 @@ void Printer::Print(const char* text,
const char* variable6, const string& value6,
const char* variable7, const string& value7,
const char* variable8, const string& value8) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars[variable1] = value1;
vars[variable2] = value2;
vars[variable3] = value3;
« no previous file with comments | « third_party/protobuf/src/google/protobuf/io/printer.h ('k') | third_party/protobuf/src/google/protobuf/io/printer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698