Commit 39a789e6 authored by Adam Cozzette's avatar Adam Cozzette Committed by Adam Cozzette

Removed using statements from common.h

These statements pulled a bunch of symbols from the std namespace into
the global namespace. This commit removes all of them except for
std::string, which is a bit trickier to remove.
parent c236896e
...@@ -754,7 +754,7 @@ void ConformanceTestSuite::TestValidDataForType( ...@@ -754,7 +754,7 @@ void ConformanceTestSuite::TestValidDataForType(
} }
void ConformanceTestSuite::SetFailureList(const string& filename, void ConformanceTestSuite::SetFailureList(const string& filename,
const vector<string>& failure_list) { const std::vector<string>& failure_list) {
failure_list_filename_ = filename; failure_list_filename_ = filename;
expected_to_fail_.clear(); expected_to_fail_.clear();
std::copy(failure_list.begin(), failure_list.end(), std::copy(failure_list.begin(), failure_list.end(),
......
...@@ -264,7 +264,7 @@ void UsageError() { ...@@ -264,7 +264,7 @@ void UsageError() {
exit(1); exit(1);
} }
void ParseFailureList(const char *filename, vector<string>* failure_list) { void ParseFailureList(const char *filename, std::vector<string>* failure_list) {
std::ifstream infile(filename); std::ifstream infile(filename);
if (!infile.is_open()) { if (!infile.is_open()) {
...@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) { ...@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) {
google::protobuf::ConformanceTestSuite suite; google::protobuf::ConformanceTestSuite suite;
string failure_list_filename; string failure_list_filename;
vector<string> failure_list; std::vector<string> failure_list;
for (int arg = 1; arg < argc; ++arg) { for (int arg = 1; arg < argc; ++arg) {
if (strcmp(argv[arg], "--failure_list") == 0) { if (strcmp(argv[arg], "--failure_list") == 0) {
......
...@@ -226,7 +226,7 @@ bool IsInstalledProtoPath(const string& path) { ...@@ -226,7 +226,7 @@ bool IsInstalledProtoPath(const string& path) {
// Add the paths where google/protobuf/descriptor.proto and other well-known // Add the paths where google/protobuf/descriptor.proto and other well-known
// type protos are installed. // type protos are installed.
void AddDefaultProtoPaths(vector<pair<string, string> >* paths) { void AddDefaultProtoPaths(std::vector<std::pair<string, string> >* paths) {
// TODO(xiaofeng): The code currently only checks relative paths of where // TODO(xiaofeng): The code currently only checks relative paths of where
// the protoc binary is installed. We probably should make it handle more // the protoc binary is installed. We probably should make it handle more
// cases than that. // cases than that.
...@@ -242,12 +242,12 @@ void AddDefaultProtoPaths(vector<pair<string, string> >* paths) { ...@@ -242,12 +242,12 @@ void AddDefaultProtoPaths(vector<pair<string, string> >* paths) {
path = path.substr(0, pos); path = path.substr(0, pos);
// Check the binary's directory. // Check the binary's directory.
if (IsInstalledProtoPath(path)) { if (IsInstalledProtoPath(path)) {
paths->push_back(pair<string, string>("", path)); paths->push_back(std::pair<string, string>("", path));
return; return;
} }
// Check if there is an include subdirectory. // Check if there is an include subdirectory.
if (IsInstalledProtoPath(path + "/include")) { if (IsInstalledProtoPath(path + "/include")) {
paths->push_back(pair<string, string>("", path + "/include")); paths->push_back(std::pair<string, string>("", path + "/include"));
return; return;
} }
// Check if the upper level directory has an "include" subdirectory. // Check if the upper level directory has an "include" subdirectory.
...@@ -257,7 +257,7 @@ void AddDefaultProtoPaths(vector<pair<string, string> >* paths) { ...@@ -257,7 +257,7 @@ void AddDefaultProtoPaths(vector<pair<string, string> >* paths) {
} }
path = path.substr(0, pos); path = path.substr(0, pos);
if (IsInstalledProtoPath(path + "/include")) { if (IsInstalledProtoPath(path + "/include")) {
paths->push_back(pair<string, string>("", path + "/include")); paths->push_back(std::pair<string, string>("", path + "/include"));
return; return;
} }
} }
......
...@@ -56,7 +56,7 @@ void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) { ...@@ -56,7 +56,7 @@ void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
// node of a summary element, not part of an attribute. // node of a summary element, not part of an attribute.
comments = StringReplace(comments, "&", "&amp;", true); comments = StringReplace(comments, "&", "&amp;", true);
comments = StringReplace(comments, "<", "&lt;", true); comments = StringReplace(comments, "<", "&lt;", true);
vector<string> lines = Split(comments, "\n", false /* skip_empty */); std::vector<string> lines = Split(comments, "\n", false /* skip_empty */);
// TODO: We really should work out which part to put in the summary and which to put in the remarks... // TODO: We really should work out which part to put in the summary and which to put in the remarks...
// but that needs to be part of a bigger effort to understand the markdown better anyway. // but that needs to be part of a bigger effort to understand the markdown better anyway.
printer->Print("/// <summary>\n"); printer->Print("/// <summary>\n");
......
...@@ -64,7 +64,7 @@ bool Generator::Generate( ...@@ -64,7 +64,7 @@ bool Generator::Generate(
GeneratorContext* generator_context, GeneratorContext* generator_context,
string* error) const { string* error) const {
vector<pair<string, string> > options; std::vector<std::pair<string, string> > options;
ParseGeneratorParameter(parameter, &options); ParseGeneratorParameter(parameter, &options);
// We only support proto3 - but we make an exception for descriptor.proto. // We only support proto3 - but we make an exception for descriptor.proto.
......
...@@ -68,13 +68,13 @@ class EnumGenerator { ...@@ -68,13 +68,13 @@ class EnumGenerator {
// considered equivalent. We treat the first defined constant for any // considered equivalent. We treat the first defined constant for any
// given numeric value as "canonical" and the rest as aliases of that // given numeric value as "canonical" and the rest as aliases of that
// canonical value. // canonical value.
vector<const EnumValueDescriptor*> canonical_values_; std::vector<const EnumValueDescriptor*> canonical_values_;
struct Alias { struct Alias {
const EnumValueDescriptor* value; const EnumValueDescriptor* value;
const EnumValueDescriptor* canonical_value; const EnumValueDescriptor* canonical_value;
}; };
vector<Alias> aliases_; std::vector<Alias> aliases_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
}; };
......
...@@ -83,7 +83,7 @@ void SetEnumVariables(const Params& params, ...@@ -83,7 +83,7 @@ void SetEnumVariables(const Params& params,
} }
void LoadEnumValues(const Params& params, void LoadEnumValues(const Params& params,
const EnumDescriptor* enum_descriptor, vector<string>* canonical_values) { const EnumDescriptor* enum_descriptor, std::vector<string>* canonical_values) {
string enum_class_name = ClassName(params, enum_descriptor); string enum_class_name = ClassName(params, enum_descriptor);
for (int i = 0; i < enum_descriptor->value_count(); i++) { for (int i = 0; i < enum_descriptor->value_count(); i++) {
const EnumValueDescriptor* value = enum_descriptor->value(i); const EnumValueDescriptor* value = enum_descriptor->value(i);
...@@ -97,7 +97,7 @@ void LoadEnumValues(const Params& params, ...@@ -97,7 +97,7 @@ void LoadEnumValues(const Params& params,
} }
void PrintCaseLabels( void PrintCaseLabels(
io::Printer* printer, const vector<string>& canonical_values) { io::Printer* printer, const std::vector<string>& canonical_values) {
for (int i = 0; i < canonical_values.size(); i++) { for (int i = 0; i < canonical_values.size(); i++) {
printer->Print( printer->Print(
" case $value$:\n", " case $value$:\n",
......
...@@ -63,7 +63,7 @@ class EnumFieldGenerator : public FieldGenerator { ...@@ -63,7 +63,7 @@ class EnumFieldGenerator : public FieldGenerator {
private: private:
const FieldDescriptor* descriptor_; const FieldDescriptor* descriptor_;
std::map<string, string> variables_; std::map<string, string> variables_;
vector<string> canonical_values_; std::vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator);
}; };
...@@ -86,7 +86,7 @@ class AccessorEnumFieldGenerator : public FieldGenerator { ...@@ -86,7 +86,7 @@ class AccessorEnumFieldGenerator : public FieldGenerator {
private: private:
const FieldDescriptor* descriptor_; const FieldDescriptor* descriptor_;
std::map<string, string> variables_; std::map<string, string> variables_;
vector<string> canonical_values_; std::vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorEnumFieldGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorEnumFieldGenerator);
}; };
...@@ -113,7 +113,7 @@ class RepeatedEnumFieldGenerator : public FieldGenerator { ...@@ -113,7 +113,7 @@ class RepeatedEnumFieldGenerator : public FieldGenerator {
const FieldDescriptor* descriptor_; const FieldDescriptor* descriptor_;
std::map<string, string> variables_; std::map<string, string> variables_;
vector<string> canonical_values_; std::vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator);
}; };
......
...@@ -59,7 +59,7 @@ bool UsesExtensions(const Message& message) { ...@@ -59,7 +59,7 @@ bool UsesExtensions(const Message& message) {
// We conservatively assume that unknown fields are extensions. // We conservatively assume that unknown fields are extensions.
if (reflection->GetUnknownFields(message).field_count() > 0) return true; if (reflection->GetUnknownFields(message).field_count() > 0) return true;
vector<const FieldDescriptor*> fields; std::vector<const FieldDescriptor*> fields;
reflection->ListFields(message, &fields); reflection->ListFields(message, &fields);
for (int i = 0; i < fields.size(); i++) { for (int i = 0; i < fields.size(); i++) {
...@@ -216,7 +216,7 @@ static void GenerateSibling(const string& package_dir, ...@@ -216,7 +216,7 @@ static void GenerateSibling(const string& package_dir,
const string& java_package, const string& java_package,
const DescriptorClass* descriptor, const DescriptorClass* descriptor,
GeneratorContext* output_directory, GeneratorContext* output_directory,
vector<string>* file_list, std::vector<string>* file_list,
const Params& params) { const Params& params) {
string filename = package_dir + descriptor->name() + ".java"; string filename = package_dir + descriptor->name() + ".java";
file_list->push_back(filename); file_list->push_back(filename);
...@@ -239,7 +239,7 @@ static void GenerateSibling(const string& package_dir, ...@@ -239,7 +239,7 @@ static void GenerateSibling(const string& package_dir,
void FileGenerator::GenerateSiblings(const string& package_dir, void FileGenerator::GenerateSiblings(const string& package_dir,
GeneratorContext* output_directory, GeneratorContext* output_directory,
vector<string>* file_list) { std::vector<string>* file_list) {
if (params_.java_multiple_files(file_->name())) { if (params_.java_multiple_files(file_->name())) {
for (int i = 0; i < file_->message_type_count(); i++) { for (int i = 0; i < file_->message_type_count(); i++) {
GenerateSibling<MessageGenerator>(package_dir, java_package_, GenerateSibling<MessageGenerator>(package_dir, java_package_,
......
...@@ -72,7 +72,7 @@ class FileGenerator { ...@@ -72,7 +72,7 @@ class FileGenerator {
// service type). // service type).
void GenerateSiblings(const string& package_dir, void GenerateSiblings(const string& package_dir,
GeneratorContext* output_directory, GeneratorContext* output_directory,
vector<string>* file_list); std::vector<string>* file_list);
const string& java_package() { return java_package_; } const string& java_package() { return java_package_; }
const string& classname() { return classname_; } const string& classname() { return classname_; }
......
...@@ -94,7 +94,7 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file, ...@@ -94,7 +94,7 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file,
const string& parameter, const string& parameter,
GeneratorContext* output_directory, GeneratorContext* output_directory,
string* error) const { string* error) const {
vector<pair<string, string> > options; std::vector<std::pair<string, string> > options;
ParseGeneratorParameter(parameter, &options); ParseGeneratorParameter(parameter, &options);
...@@ -116,24 +116,24 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file, ...@@ -116,24 +116,24 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file,
if (option_name == "output_list_file") { if (option_name == "output_list_file") {
output_list_file = option_value; output_list_file = option_value;
} else if (option_name == "java_package") { } else if (option_name == "java_package") {
vector<string> parts; std::vector<string> parts;
SplitStringUsing(option_value, "|", &parts); SplitStringUsing(option_value, "|", &parts);
if (parts.size() != 2) { if (parts.size() != 2) {
*error = "Bad java_package, expecting filename|PackageName found '" *error = "Bad java_package, expecting filename|PackageName found '"
+ option_value + "'"; + option_value + "'";
return false; return false;
} }
params.set_java_package(parts[0], parts[1]); params.set_java_package(parts[0], parts[1]);
} else if (option_name == "java_outer_classname") { } else if (option_name == "java_outer_classname") {
vector<string> parts; std::vector<string> parts;
SplitStringUsing(option_value, "|", &parts); SplitStringUsing(option_value, "|", &parts);
if (parts.size() != 2) { if (parts.size() != 2) {
*error = "Bad java_outer_classname, " *error = "Bad java_outer_classname, "
"expecting filename|ClassName found '" "expecting filename|ClassName found '"
+ option_value + "'"; + option_value + "'";
return false; return false;
} }
params.set_java_outer_classname(parts[0], parts[1]); params.set_java_outer_classname(parts[0], parts[1]);
} else if (option_name == "store_unknown_fields") { } else if (option_name == "store_unknown_fields") {
params.set_store_unknown_fields(option_value == "true"); params.set_store_unknown_fields(option_value == "true");
} else if (option_name == "java_multiple_files") { } else if (option_name == "java_multiple_files") {
...@@ -191,7 +191,7 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file, ...@@ -191,7 +191,7 @@ bool JavaNanoGenerator::Generate(const FileDescriptor* file,
StringReplace(file_generator.java_package(), ".", "/", true); StringReplace(file_generator.java_package(), ".", "/", true);
if (!package_dir.empty()) package_dir += "/"; if (!package_dir.empty()) package_dir += "/";
vector<string> all_files; std::vector<string> all_files;
if (IsOuterClassNeeded(params, file)) { if (IsOuterClassNeeded(params, file)) {
string java_filename = package_dir; string java_filename = package_dir;
......
...@@ -59,8 +59,8 @@ class EnumGenerator { ...@@ -59,8 +59,8 @@ class EnumGenerator {
private: private:
const EnumDescriptor* descriptor_; const EnumDescriptor* descriptor_;
vector<const EnumValueDescriptor*> base_values_; std::vector<const EnumValueDescriptor*> base_values_;
vector<const EnumValueDescriptor*> all_values_; std::vector<const EnumValueDescriptor*> all_values_;
const string name_; const string name_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
......
...@@ -116,9 +116,9 @@ bool FileContainsExtensions(const FileDescriptor* file) { ...@@ -116,9 +116,9 @@ bool FileContainsExtensions(const FileDescriptor* file) {
// deps as visited and prunes them from the needed files list. // deps as visited and prunes them from the needed files list.
void PruneFileAndDepsMarkingAsVisited( void PruneFileAndDepsMarkingAsVisited(
const FileDescriptor* file, const FileDescriptor* file,
vector<const FileDescriptor*>* files, std::vector<const FileDescriptor*>* files,
std::set<const FileDescriptor*>* files_visited) { std::set<const FileDescriptor*>* files_visited) {
vector<const FileDescriptor*>::iterator iter = std::vector<const FileDescriptor*>::iterator iter =
std::find(files->begin(), files->end(), file); std::find(files->begin(), files->end(), file);
if (iter != files->end()) { if (iter != files->end()) {
files->erase(iter); files->erase(iter);
...@@ -132,7 +132,7 @@ void PruneFileAndDepsMarkingAsVisited( ...@@ -132,7 +132,7 @@ void PruneFileAndDepsMarkingAsVisited(
// Helper for CollectMinimalFileDepsContainingExtensions. // Helper for CollectMinimalFileDepsContainingExtensions.
void CollectMinimalFileDepsContainingExtensionsWorker( void CollectMinimalFileDepsContainingExtensionsWorker(
const FileDescriptor* file, const FileDescriptor* file,
vector<const FileDescriptor*>* files, std::vector<const FileDescriptor*>* files,
std::set<const FileDescriptor*>* files_visited) { std::set<const FileDescriptor*>* files_visited) {
if (files_visited->find(file) != files_visited->end()) { if (files_visited->find(file) != files_visited->end()) {
return; return;
...@@ -165,7 +165,7 @@ void CollectMinimalFileDepsContainingExtensionsWorker( ...@@ -165,7 +165,7 @@ void CollectMinimalFileDepsContainingExtensionsWorker(
// specifically). // specifically).
void CollectMinimalFileDepsContainingExtensions( void CollectMinimalFileDepsContainingExtensions(
const FileDescriptor* file, const FileDescriptor* file,
vector<const FileDescriptor*>* files) { std::vector<const FileDescriptor*>* files) {
std::set<const FileDescriptor*> files_visited; std::set<const FileDescriptor*> files_visited;
for (int i = 0; i < file->dependency_count(); i++) { for (int i = 0; i < file->dependency_count(); i++) {
const FileDescriptor* dep = file->dependency(i); const FileDescriptor* dep = file->dependency(i);
...@@ -258,7 +258,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -258,7 +258,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"\n"); "\n");
std::set<string> fwd_decls; std::set<string> fwd_decls;
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); for (std::vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
(*iter)->DetermineForwardDeclarations(&fwd_decls); (*iter)->DetermineForwardDeclarations(&fwd_decls);
} }
...@@ -275,12 +275,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -275,12 +275,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"\n"); "\n");
// need to write out all enums first // need to write out all enums first
for (vector<EnumGenerator *>::iterator iter = enum_generators_.begin(); for (std::vector<EnumGenerator *>::iterator iter = enum_generators_.begin();
iter != enum_generators_.end(); ++iter) { iter != enum_generators_.end(); ++iter) {
(*iter)->GenerateHeader(printer); (*iter)->GenerateHeader(printer);
} }
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); for (std::vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
(*iter)->GenerateEnumHeader(printer); (*iter)->GenerateEnumHeader(printer);
} }
...@@ -311,7 +311,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -311,7 +311,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"@interface $root_class_name$ (DynamicMethods)\n", "@interface $root_class_name$ (DynamicMethods)\n",
"root_class_name", root_class_name_); "root_class_name", root_class_name_);
for (vector<ExtensionGenerator *>::iterator iter = for (std::vector<ExtensionGenerator *>::iterator iter =
extension_generators_.begin(); extension_generators_.begin();
iter != extension_generators_.end(); ++iter) { iter != extension_generators_.end(); ++iter) {
(*iter)->GenerateMembersHeader(printer); (*iter)->GenerateMembersHeader(printer);
...@@ -320,7 +320,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -320,7 +320,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
printer->Print("@end\n\n"); printer->Print("@end\n\n");
} // extension_generators_.size() > 0 } // extension_generators_.size() > 0
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); for (std::vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
(*iter)->GenerateMessageHeader(printer); (*iter)->GenerateMessageHeader(printer);
} }
...@@ -346,7 +346,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -346,7 +346,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
"\n"); "\n");
} }
vector<const FileDescriptor*> deps_with_extensions; std::vector<const FileDescriptor*> deps_with_extensions;
CollectMinimalFileDepsContainingExtensions(file_, &deps_with_extensions); CollectMinimalFileDepsContainingExtensions(file_, &deps_with_extensions);
{ {
...@@ -376,7 +376,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -376,7 +376,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// imported so it can get merged into the root's extensions registry. // imported so it can get merged into the root's extensions registry.
// See the Note by CollectMinimalFileDepsContainingExtensions before // See the Note by CollectMinimalFileDepsContainingExtensions before
// changing this. // changing this.
for (vector<const FileDescriptor *>::iterator iter = for (std::vector<const FileDescriptor *>::iterator iter =
deps_with_extensions.begin(); deps_with_extensions.begin();
iter != deps_with_extensions.end(); ++iter) { iter != deps_with_extensions.end(); ++iter) {
if (!IsDirectDependency(*iter, file_)) { if (!IsDirectDependency(*iter, file_)) {
...@@ -388,7 +388,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -388,7 +388,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
} }
bool includes_oneof = false; bool includes_oneof = false;
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); for (std::vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
if ((*iter)->IncludesOneOfDefinition()) { if ((*iter)->IncludesOneOfDefinition()) {
includes_oneof = true; includes_oneof = true;
...@@ -441,12 +441,12 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -441,12 +441,12 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
printer->Print( printer->Print(
"static GPBExtensionDescription descriptions[] = {\n"); "static GPBExtensionDescription descriptions[] = {\n");
printer->Indent(); printer->Indent();
for (vector<ExtensionGenerator *>::iterator iter = for (std::vector<ExtensionGenerator *>::iterator iter =
extension_generators_.begin(); extension_generators_.begin();
iter != extension_generators_.end(); ++iter) { iter != extension_generators_.end(); ++iter) {
(*iter)->GenerateStaticVariablesInitialization(printer); (*iter)->GenerateStaticVariablesInitialization(printer);
} }
for (vector<MessageGenerator *>::iterator iter = for (std::vector<MessageGenerator *>::iterator iter =
message_generators_.begin(); message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
(*iter)->GenerateStaticVariablesInitialization(printer); (*iter)->GenerateStaticVariablesInitialization(printer);
...@@ -470,7 +470,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -470,7 +470,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
} else { } else {
printer->Print( printer->Print(
"// Merge in the imports (direct or indirect) that defined extensions.\n"); "// Merge in the imports (direct or indirect) that defined extensions.\n");
for (vector<const FileDescriptor *>::iterator iter = for (std::vector<const FileDescriptor *>::iterator iter =
deps_with_extensions.begin(); deps_with_extensions.begin();
iter != deps_with_extensions.end(); ++iter) { iter != deps_with_extensions.end(); ++iter) {
const string root_class_name(FileClassName((*iter))); const string root_class_name(FileClassName((*iter)));
...@@ -546,11 +546,11 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -546,11 +546,11 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
"\n"); "\n");
} }
for (vector<EnumGenerator *>::iterator iter = enum_generators_.begin(); for (std::vector<EnumGenerator *>::iterator iter = enum_generators_.begin();
iter != enum_generators_.end(); ++iter) { iter != enum_generators_.end(); ++iter) {
(*iter)->GenerateSource(printer); (*iter)->GenerateSource(printer);
} }
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); for (std::vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) { iter != message_generators_.end(); ++iter) {
(*iter)->GenerateSource(printer); (*iter)->GenerateSource(printer);
} }
......
...@@ -67,9 +67,9 @@ class FileGenerator { ...@@ -67,9 +67,9 @@ class FileGenerator {
const FileDescriptor* file_; const FileDescriptor* file_;
string root_class_name_; string root_class_name_;
vector<EnumGenerator*> enum_generators_; std::vector<EnumGenerator*> enum_generators_;
vector<MessageGenerator*> message_generators_; std::vector<MessageGenerator*> message_generators_;
vector<ExtensionGenerator*> extension_generators_; std::vector<ExtensionGenerator*> extension_generators_;
const Options options_; const Options options_;
......
...@@ -57,7 +57,7 @@ bool ObjectiveCGenerator::Generate(const FileDescriptor* file, ...@@ -57,7 +57,7 @@ bool ObjectiveCGenerator::Generate(const FileDescriptor* file,
return false; return false;
} }
bool ObjectiveCGenerator::GenerateAll(const vector<const FileDescriptor*>& files, bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>& files,
const string& parameter, const string& parameter,
GeneratorContext* context, GeneratorContext* context,
string* error) const { string* error) const {
...@@ -71,7 +71,7 @@ bool ObjectiveCGenerator::GenerateAll(const vector<const FileDescriptor*>& files ...@@ -71,7 +71,7 @@ bool ObjectiveCGenerator::GenerateAll(const vector<const FileDescriptor*>& files
Options generation_options; Options generation_options;
vector<pair<string, string> > options; std::vector<std::pair<string, string> > options;
ParseGeneratorParameter(parameter, &options); ParseGeneratorParameter(parameter, &options);
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
if (options[i].first == "expected_prefixes_path") { if (options[i].first == "expected_prefixes_path") {
......
...@@ -56,7 +56,7 @@ class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { ...@@ -56,7 +56,7 @@ class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator {
const string& parameter, const string& parameter,
GeneratorContext* context, GeneratorContext* context,
string* error) const; string* error) const;
bool GenerateAll(const vector<const FileDescriptor*>& files, bool GenerateAll(const std::vector<const FileDescriptor*>& files,
const string& parameter, const string& parameter,
GeneratorContext* context, GeneratorContext* context,
string* error) const; string* error) const;
......
...@@ -100,7 +100,7 @@ bool ascii_isnewline(char c) { ...@@ -100,7 +100,7 @@ bool ascii_isnewline(char c) {
// Do not expose this outside of helpers, stick to having functions for specific // Do not expose this outside of helpers, stick to having functions for specific
// cases (ClassName(), FieldName()), so there is always consistent suffix rules. // cases (ClassName(), FieldName()), so there is always consistent suffix rules.
string UnderscoresToCamelCase(const string& input, bool first_capitalized) { string UnderscoresToCamelCase(const string& input, bool first_capitalized) {
vector<string> values; std::vector<string> values;
string current; string current;
bool last_char_was_number = false; bool last_char_was_number = false;
...@@ -141,7 +141,7 @@ string UnderscoresToCamelCase(const string& input, bool first_capitalized) { ...@@ -141,7 +141,7 @@ string UnderscoresToCamelCase(const string& input, bool first_capitalized) {
string result; string result;
bool first_segment_forces_upper = false; bool first_segment_forces_upper = false;
for (vector<string>::iterator i = values.begin(); i != values.end(); ++i) { for (std::vector<string>::iterator i = values.begin(); i != values.end(); ++i) {
string value = *i; string value = *i;
bool all_upper = (kUpperSegments.count(value) > 0); bool all_upper = (kUpperSegments.count(value) > 0);
if (all_upper && (result.length() == 0)) { if (all_upper && (result.length() == 0)) {
...@@ -864,7 +864,7 @@ bool HasNonZeroDefaultValue(const FieldDescriptor* field) { ...@@ -864,7 +864,7 @@ bool HasNonZeroDefaultValue(const FieldDescriptor* field) {
} }
string BuildFlagsString(const FlagType flag_type, string BuildFlagsString(const FlagType flag_type,
const vector<string>& strings) { const std::vector<string>& strings) {
if (strings.size() == 0) { if (strings.size() == 0) {
return GetZeroEnumNameForFlagType(flag_type); return GetZeroEnumNameForFlagType(flag_type);
} else if (strings.size() == 1) { } else if (strings.size() == 1) {
...@@ -886,7 +886,7 @@ string BuildCommentsString(const SourceLocation& location, ...@@ -886,7 +886,7 @@ string BuildCommentsString(const SourceLocation& location,
const string& comments = location.leading_comments.empty() const string& comments = location.leading_comments.empty()
? location.trailing_comments ? location.trailing_comments
: location.leading_comments; : location.leading_comments;
vector<string> lines; std::vector<string> lines;
SplitStringAllowEmpty(comments, "\n", &lines); SplitStringAllowEmpty(comments, "\n", &lines);
while (!lines.empty() && lines.back().empty()) { while (!lines.empty() && lines.back().empty()) {
lines.pop_back(); lines.pop_back();
...@@ -1156,7 +1156,7 @@ bool ValidateObjCClassPrefix( ...@@ -1156,7 +1156,7 @@ bool ValidateObjCClassPrefix(
} // namespace } // namespace
bool ValidateObjCClassPrefixes(const vector<const FileDescriptor*>& files, bool ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,
const Options& generation_options, const Options& generation_options,
string* out_error) { string* out_error) {
// Load the expected package prefixes, if available, to validate against. // Load the expected package prefixes, if available, to validate against.
...@@ -1187,7 +1187,7 @@ TextFormatDecodeData::~TextFormatDecodeData() { } ...@@ -1187,7 +1187,7 @@ TextFormatDecodeData::~TextFormatDecodeData() { }
void TextFormatDecodeData::AddString(int32 key, void TextFormatDecodeData::AddString(int32 key,
const string& input_for_decode, const string& input_for_decode,
const string& desired_output) { const string& desired_output) {
for (vector<DataEntry>::const_iterator i = entries_.begin(); for (std::vector<DataEntry>::const_iterator i = entries_.begin();
i != entries_.end(); ++i) { i != entries_.end(); ++i) {
if (i->first == key) { if (i->first == key) {
std::cerr << "error: duplicate key (" << key std::cerr << "error: duplicate key (" << key
...@@ -1211,7 +1211,7 @@ string TextFormatDecodeData::Data() const { ...@@ -1211,7 +1211,7 @@ string TextFormatDecodeData::Data() const {
io::CodedOutputStream output_stream(&data_outputstream); io::CodedOutputStream output_stream(&data_outputstream);
output_stream.WriteVarint32(num_entries()); output_stream.WriteVarint32(num_entries());
for (vector<DataEntry>::const_iterator i = entries_.begin(); for (std::vector<DataEntry>::const_iterator i = entries_.begin();
i != entries_.end(); ++i) { i != entries_.end(); ++i) {
output_stream.WriteVarint32(i->first); output_stream.WriteVarint32(i->first);
output_stream.WriteString(i->second); output_stream.WriteString(i->second);
...@@ -1561,7 +1561,7 @@ void ImportWriter::Print(io::Printer* printer) const { ...@@ -1561,7 +1561,7 @@ void ImportWriter::Print(io::Printer* printer) const {
printer->Print( printer->Print(
"#if $cpp_symbol$\n", "#if $cpp_symbol$\n",
"cpp_symbol", cpp_symbol); "cpp_symbol", cpp_symbol);
for (vector<string>::const_iterator iter = protobuf_framework_imports_.begin(); for (std::vector<string>::const_iterator iter = protobuf_framework_imports_.begin();
iter != protobuf_framework_imports_.end(); ++iter) { iter != protobuf_framework_imports_.end(); ++iter) {
printer->Print( printer->Print(
" #import <$framework_name$/$header$>\n", " #import <$framework_name$/$header$>\n",
...@@ -1570,7 +1570,7 @@ void ImportWriter::Print(io::Printer* printer) const { ...@@ -1570,7 +1570,7 @@ void ImportWriter::Print(io::Printer* printer) const {
} }
printer->Print( printer->Print(
"#else\n"); "#else\n");
for (vector<string>::const_iterator iter = protobuf_non_framework_imports_.begin(); for (std::vector<string>::const_iterator iter = protobuf_non_framework_imports_.begin();
iter != protobuf_non_framework_imports_.end(); ++iter) { iter != protobuf_non_framework_imports_.end(); ++iter) {
printer->Print( printer->Print(
" #import \"$header$\"\n", " #import \"$header$\"\n",
...@@ -1587,7 +1587,7 @@ void ImportWriter::Print(io::Printer* printer) const { ...@@ -1587,7 +1587,7 @@ void ImportWriter::Print(io::Printer* printer) const {
printer->Print("\n"); printer->Print("\n");
} }
for (vector<string>::const_iterator iter = other_framework_imports_.begin(); for (std::vector<string>::const_iterator iter = other_framework_imports_.begin();
iter != other_framework_imports_.end(); ++iter) { iter != other_framework_imports_.end(); ++iter) {
printer->Print( printer->Print(
" #import <$header$>\n", " #import <$header$>\n",
...@@ -1602,7 +1602,7 @@ void ImportWriter::Print(io::Printer* printer) const { ...@@ -1602,7 +1602,7 @@ void ImportWriter::Print(io::Printer* printer) const {
printer->Print("\n"); printer->Print("\n");
} }
for (vector<string>::const_iterator iter = other_imports_.begin(); for (std::vector<string>::const_iterator iter = other_imports_.begin();
iter != other_imports_.end(); ++iter) { iter != other_imports_.end(); ++iter) {
printer->Print( printer->Print(
" #import \"$header$\"\n", " #import \"$header$\"\n",
......
...@@ -190,7 +190,7 @@ string LIBPROTOC_EXPORT GPBGenericValueFieldName(const FieldDescriptor* field); ...@@ -190,7 +190,7 @@ string LIBPROTOC_EXPORT GPBGenericValueFieldName(const FieldDescriptor* field);
string LIBPROTOC_EXPORT DefaultValue(const FieldDescriptor* field); string LIBPROTOC_EXPORT DefaultValue(const FieldDescriptor* field);
bool LIBPROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field); bool LIBPROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field);
string LIBPROTOC_EXPORT BuildFlagsString(const FlagType type, const vector<string>& strings); string LIBPROTOC_EXPORT BuildFlagsString(const FlagType type, const std::vector<string>& strings);
// Builds HeaderDoc/appledoc style comments out of the comments in the .proto // Builds HeaderDoc/appledoc style comments out of the comments in the .proto
// file. // file.
...@@ -210,7 +210,7 @@ bool LIBPROTOC_EXPORT IsProtobufLibraryBundledProtoFile(const FileDescriptor* fi ...@@ -210,7 +210,7 @@ bool LIBPROTOC_EXPORT IsProtobufLibraryBundledProtoFile(const FileDescriptor* fi
// Checks the prefix for the given files and outputs any warnings as needed. If // Checks the prefix for the given files and outputs any warnings as needed. If
// there are flat out errors, then out_error is filled in with the first error // there are flat out errors, then out_error is filled in with the first error
// and the result is false. // and the result is false.
bool LIBPROTOC_EXPORT ValidateObjCClassPrefixes(const vector<const FileDescriptor*>& files, bool LIBPROTOC_EXPORT ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,
const Options& generation_options, const Options& generation_options,
string* out_error); string* out_error);
...@@ -233,7 +233,7 @@ class LIBPROTOC_EXPORT TextFormatDecodeData { ...@@ -233,7 +233,7 @@ class LIBPROTOC_EXPORT TextFormatDecodeData {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextFormatDecodeData); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextFormatDecodeData);
typedef std::pair<int32, string> DataEntry; typedef std::pair<int32, string> DataEntry;
vector<DataEntry> entries_; std::vector<DataEntry> entries_;
}; };
// Helper for parsing simple files. // Helper for parsing simple files.
...@@ -278,10 +278,10 @@ class LIBPROTOC_EXPORT ImportWriter { ...@@ -278,10 +278,10 @@ class LIBPROTOC_EXPORT ImportWriter {
std::map<string, string> proto_file_to_framework_name_; std::map<string, string> proto_file_to_framework_name_;
bool need_to_parse_mapping_file_; bool need_to_parse_mapping_file_;
vector<string> protobuf_framework_imports_; std::vector<string> protobuf_framework_imports_;
vector<string> protobuf_non_framework_imports_; std::vector<string> protobuf_non_framework_imports_;
vector<string> other_framework_imports_; std::vector<string> other_framework_imports_;
vector<string> other_imports_; std::vector<string> other_imports_;
}; };
} // namespace objectivec } // namespace objectivec
......
...@@ -220,13 +220,13 @@ MessageGenerator::~MessageGenerator() { ...@@ -220,13 +220,13 @@ MessageGenerator::~MessageGenerator() {
void MessageGenerator::GenerateStaticVariablesInitialization( void MessageGenerator::GenerateStaticVariablesInitialization(
io::Printer* printer) { io::Printer* printer) {
for (vector<ExtensionGenerator*>::iterator iter = for (std::vector<ExtensionGenerator*>::iterator iter =
extension_generators_.begin(); extension_generators_.begin();
iter != extension_generators_.end(); ++iter) { iter != extension_generators_.end(); ++iter) {
(*iter)->GenerateStaticVariablesInitialization(printer); (*iter)->GenerateStaticVariablesInitialization(printer);
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateStaticVariablesInitialization(printer); (*iter)->GenerateStaticVariablesInitialization(printer);
...@@ -242,7 +242,7 @@ void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls) ...@@ -242,7 +242,7 @@ void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls)
} }
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->DetermineForwardDeclarations(fwd_decls); (*iter)->DetermineForwardDeclarations(fwd_decls);
...@@ -254,7 +254,7 @@ bool MessageGenerator::IncludesOneOfDefinition() const { ...@@ -254,7 +254,7 @@ bool MessageGenerator::IncludesOneOfDefinition() const {
return true; return true;
} }
for (vector<MessageGenerator*>::const_iterator iter = for (std::vector<MessageGenerator*>::const_iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
if ((*iter)->IncludesOneOfDefinition()) { if ((*iter)->IncludesOneOfDefinition()) {
...@@ -266,12 +266,12 @@ bool MessageGenerator::IncludesOneOfDefinition() const { ...@@ -266,12 +266,12 @@ bool MessageGenerator::IncludesOneOfDefinition() const {
} }
void MessageGenerator::GenerateEnumHeader(io::Printer* printer) { void MessageGenerator::GenerateEnumHeader(io::Printer* printer) {
for (vector<EnumGenerator*>::iterator iter = enum_generators_.begin(); for (std::vector<EnumGenerator*>::iterator iter = enum_generators_.begin();
iter != enum_generators_.end(); ++iter) { iter != enum_generators_.end(); ++iter) {
(*iter)->GenerateHeader(printer); (*iter)->GenerateHeader(printer);
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateEnumHeader(printer); (*iter)->GenerateEnumHeader(printer);
...@@ -280,13 +280,13 @@ void MessageGenerator::GenerateEnumHeader(io::Printer* printer) { ...@@ -280,13 +280,13 @@ void MessageGenerator::GenerateEnumHeader(io::Printer* printer) {
void MessageGenerator::GenerateExtensionRegistrationSource( void MessageGenerator::GenerateExtensionRegistrationSource(
io::Printer* printer) { io::Printer* printer) {
for (vector<ExtensionGenerator*>::iterator iter = for (std::vector<ExtensionGenerator*>::iterator iter =
extension_generators_.begin(); extension_generators_.begin();
iter != extension_generators_.end(); ++iter) { iter != extension_generators_.end(); ++iter) {
(*iter)->GenerateRegistrationSource(printer); (*iter)->GenerateRegistrationSource(printer);
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateExtensionRegistrationSource(printer); (*iter)->GenerateExtensionRegistrationSource(printer);
...@@ -296,7 +296,7 @@ void MessageGenerator::GenerateExtensionRegistrationSource( ...@@ -296,7 +296,7 @@ void MessageGenerator::GenerateExtensionRegistrationSource(
void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
// This a a map entry message, just recurse and do nothing directly. // This a a map entry message, just recurse and do nothing directly.
if (IsMapEntryMessage(descriptor_)) { if (IsMapEntryMessage(descriptor_)) {
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateMessageHeader(printer); (*iter)->GenerateMessageHeader(printer);
...@@ -326,7 +326,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { ...@@ -326,7 +326,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
printer->Print("};\n\n"); printer->Print("};\n\n");
} }
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
(*iter)->GenerateCaseEnum(printer); (*iter)->GenerateCaseEnum(printer);
} }
...@@ -345,7 +345,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { ...@@ -345,7 +345,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
"deprecated_attribute", deprecated_attribute_, "deprecated_attribute", deprecated_attribute_,
"comments", message_comments); "comments", message_comments);
vector<char> seen_oneofs(descriptor_->oneof_decl_count(), 0); std::vector<char> seen_oneofs(descriptor_->oneof_decl_count(), 0);
for (int i = 0; i < descriptor_->field_count(); i++) { for (int i = 0; i < descriptor_->field_count(); i++) {
const FieldDescriptor* field = descriptor_->field(i); const FieldDescriptor* field = descriptor_->field(i);
if (field->containing_oneof() != NULL) { if (field->containing_oneof() != NULL) {
...@@ -367,7 +367,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { ...@@ -367,7 +367,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
} }
if (!oneof_generators_.empty()) { if (!oneof_generators_.empty()) {
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
(*iter)->GenerateClearFunctionDeclaration(printer); (*iter)->GenerateClearFunctionDeclaration(printer);
} }
...@@ -377,7 +377,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { ...@@ -377,7 +377,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
if (descriptor_->extension_count() > 0) { if (descriptor_->extension_count() > 0) {
printer->Print("@interface $classname$ (DynamicMethods)\n\n", printer->Print("@interface $classname$ (DynamicMethods)\n\n",
"classname", class_name_); "classname", class_name_);
for (vector<ExtensionGenerator*>::iterator iter = for (std::vector<ExtensionGenerator*>::iterator iter =
extension_generators_.begin(); extension_generators_.begin();
iter != extension_generators_.end(); ++iter) { iter != extension_generators_.end(); ++iter) {
(*iter)->GenerateMembersHeader(printer); (*iter)->GenerateMembersHeader(printer);
...@@ -385,7 +385,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) { ...@@ -385,7 +385,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
printer->Print("@end\n\n"); printer->Print("@end\n\n");
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateMessageHeader(printer); (*iter)->GenerateMessageHeader(printer);
...@@ -410,7 +410,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { ...@@ -410,7 +410,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
printer->Print("@implementation $classname$\n\n", printer->Print("@implementation $classname$\n\n",
"classname", class_name_); "classname", class_name_);
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
(*iter)->GeneratePropertyImplementation(printer); (*iter)->GeneratePropertyImplementation(printer);
} }
...@@ -425,7 +425,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { ...@@ -425,7 +425,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
scoped_array<const FieldDescriptor*> size_order_fields( scoped_array<const FieldDescriptor*> size_order_fields(
SortFieldsByStorageSize(descriptor_)); SortFieldsByStorageSize(descriptor_));
vector<const Descriptor::ExtensionRange*> sorted_extensions; std::vector<const Descriptor::ExtensionRange*> sorted_extensions;
for (int i = 0; i < descriptor_->extension_range_count(); ++i) { for (int i = 0; i < descriptor_->extension_range_count(); ++i) {
sorted_extensions.push_back(descriptor_->extension_range(i)); sorted_extensions.push_back(descriptor_->extension_range(i));
} }
...@@ -448,7 +448,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { ...@@ -448,7 +448,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
sizeof_has_storage = 1; sizeof_has_storage = 1;
} }
// Tell all the fields the oneof base. // Tell all the fields the oneof base.
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
(*iter)->SetOneofIndexBase(sizeof_has_storage); (*iter)->SetOneofIndexBase(sizeof_has_storage);
} }
...@@ -548,7 +548,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { ...@@ -548,7 +548,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
if (oneof_generators_.size() != 0) { if (oneof_generators_.size() != 0) {
printer->Print( printer->Print(
" static const char *oneofs[] = {\n"); " static const char *oneofs[] = {\n");
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
printer->Print( printer->Print(
" \"$name$\",\n", " \"$name$\",\n",
...@@ -623,18 +623,18 @@ void MessageGenerator::GenerateSource(io::Printer* printer) { ...@@ -623,18 +623,18 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
.GenerateCFunctionImplementations(printer); .GenerateCFunctionImplementations(printer);
} }
for (vector<OneofGenerator*>::iterator iter = oneof_generators_.begin(); for (std::vector<OneofGenerator*>::iterator iter = oneof_generators_.begin();
iter != oneof_generators_.end(); ++iter) { iter != oneof_generators_.end(); ++iter) {
(*iter)->GenerateClearFunctionImplementation(printer); (*iter)->GenerateClearFunctionImplementation(printer);
} }
} }
for (vector<EnumGenerator*>::iterator iter = enum_generators_.begin(); for (std::vector<EnumGenerator*>::iterator iter = enum_generators_.begin();
iter != enum_generators_.end(); ++iter) { iter != enum_generators_.end(); ++iter) {
(*iter)->GenerateSource(printer); (*iter)->GenerateSource(printer);
} }
for (vector<MessageGenerator*>::iterator iter = for (std::vector<MessageGenerator*>::iterator iter =
nested_message_generators_.begin(); nested_message_generators_.begin();
iter != nested_message_generators_.end(); ++iter) { iter != nested_message_generators_.end(); ++iter) {
(*iter)->GenerateSource(printer); (*iter)->GenerateSource(printer);
......
...@@ -86,10 +86,10 @@ class MessageGenerator { ...@@ -86,10 +86,10 @@ class MessageGenerator {
FieldGeneratorMap field_generators_; FieldGeneratorMap field_generators_;
const string class_name_; const string class_name_;
const string deprecated_attribute_; const string deprecated_attribute_;
vector<ExtensionGenerator*> extension_generators_; std::vector<ExtensionGenerator*> extension_generators_;
vector<EnumGenerator*> enum_generators_; std::vector<EnumGenerator*> enum_generators_;
vector<MessageGenerator*> nested_message_generators_; std::vector<MessageGenerator*> nested_message_generators_;
vector<OneofGenerator*> oneof_generators_; std::vector<OneofGenerator*> oneof_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator);
}; };
......
...@@ -1265,7 +1265,7 @@ static void GenerateDocCommentBodyForLocation( ...@@ -1265,7 +1265,7 @@ static void GenerateDocCommentBodyForLocation(
// HTML-escape them so that they don't accidentally close the doc comment. // HTML-escape them so that they don't accidentally close the doc comment.
comments = EscapePhpdoc(comments); comments = EscapePhpdoc(comments);
vector<string> lines = Split(comments, "\n"); std::vector<string> lines = Split(comments, "\n");
while (!lines.empty() && lines.back().empty()) { while (!lines.empty() && lines.back().empty()) {
lines.pop_back(); lines.pop_back();
} }
......
...@@ -430,9 +430,9 @@ struct ShutdownData { ...@@ -430,9 +430,9 @@ struct ShutdownData {
} }
} }
vector<void (*)()> functions; std::vector<void (*)()> functions;
vector<const std::string*> strings; std::vector<const std::string*> strings;
vector<const MessageLite*> messages; std::vector<const MessageLite*> messages;
Mutex mutex; Mutex mutex;
}; };
......
...@@ -229,12 +229,7 @@ class FatalException : public std::exception { ...@@ -229,12 +229,7 @@ class FatalException : public std::exception {
// This is at the end of the file instead of the beginning to work around a bug // This is at the end of the file instead of the beginning to work around a bug
// in some versions of MSVC. // in some versions of MSVC.
// TODO(acozzette): remove these using statements
using std::istream;
using std::ostream;
using std::pair;
using std::string; using std::string;
using std::vector;
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google
......
...@@ -75,7 +75,7 @@ TEST(CommonTest, IntMinMaxConstants) { ...@@ -75,7 +75,7 @@ TEST(CommonTest, IntMinMaxConstants) {
EXPECT_EQ(0, kuint64max + 1); EXPECT_EQ(0, kuint64max + 1);
} }
vector<string> captured_messages_; std::vector<string> captured_messages_;
void CaptureLog(LogLevel level, const char* filename, int line, void CaptureLog(LogLevel level, const char* filename, int line,
const string& message) { const string& message) {
......
...@@ -408,8 +408,8 @@ struct hash<string> { ...@@ -408,8 +408,8 @@ struct hash<string> {
}; };
template <typename First, typename Second> template <typename First, typename Second>
struct hash<pair<First, Second> > { struct hash<std::pair<First, Second> > {
inline size_t operator()(const pair<First, Second>& key) const { inline size_t operator()(const std::pair<First, Second>& key) const {
size_t first_hash = hash<First>()(key.first); size_t first_hash = hash<First>()(key.first);
size_t second_hash = hash<Second>()(key.second); size_t second_hash = hash<Second>()(key.second);
...@@ -420,8 +420,8 @@ struct hash<pair<First, Second> > { ...@@ -420,8 +420,8 @@ struct hash<pair<First, Second> > {
static const size_t bucket_size = 4; static const size_t bucket_size = 4;
static const size_t min_buckets = 8; static const size_t min_buckets = 8;
inline bool operator()(const pair<First, Second>& a, inline bool operator()(const std::pair<First, Second>& a,
const pair<First, Second>& b) const { const std::pair<First, Second>& b) const {
return a < b; return a < b;
} }
}; };
......
...@@ -708,7 +708,7 @@ void AppendKeysFromMap(const MapContainer& map_container, ...@@ -708,7 +708,7 @@ void AppendKeysFromMap(const MapContainer& map_container,
// without the complexity of a SFINAE-based solution.) // without the complexity of a SFINAE-based solution.)
template <class MapContainer, class KeyType> template <class MapContainer, class KeyType>
void AppendKeysFromMap(const MapContainer& map_container, void AppendKeysFromMap(const MapContainer& map_container,
vector<KeyType>* key_container) { std::vector<KeyType>* key_container) {
GOOGLE_CHECK(key_container != NULL); GOOGLE_CHECK(key_container != NULL);
// We now have the opportunity to call reserve(). Calling reserve() every // We now have the opportunity to call reserve(). Calling reserve() every
// time is a bad idea for some use cases: libstdc++'s implementation of // time is a bad idea for some use cases: libstdc++'s implementation of
...@@ -752,7 +752,7 @@ void AppendValuesFromMap(const MapContainer& map_container, ...@@ -752,7 +752,7 @@ void AppendValuesFromMap(const MapContainer& map_container,
// without the complexity of a SFINAE-based solution.) // without the complexity of a SFINAE-based solution.)
template <class MapContainer, class ValueType> template <class MapContainer, class ValueType>
void AppendValuesFromMap(const MapContainer& map_container, void AppendValuesFromMap(const MapContainer& map_container,
vector<ValueType>* value_container) { std::vector<ValueType>* value_container) {
GOOGLE_CHECK(value_container != NULL); GOOGLE_CHECK(value_container != NULL);
// See AppendKeysFromMap for why this is done. // See AppendKeysFromMap for why this is done.
if (value_container->empty()) { if (value_container->empty()) {
......
...@@ -124,7 +124,7 @@ string Status::ToString() const { ...@@ -124,7 +124,7 @@ string Status::ToString() const {
} }
} }
ostream& operator<<(ostream& os, const Status& x) { std::ostream& operator<<(std::ostream& os, const Status& x) {
os << x.ToString(); os << x.ToString();
return os; return os;
} }
......
...@@ -106,7 +106,7 @@ class LIBPROTOBUF_EXPORT Status { ...@@ -106,7 +106,7 @@ class LIBPROTOBUF_EXPORT Status {
}; };
// Prints a human-readable representation of 'x' to 'os'. // Prints a human-readable representation of 'x' to 'os'.
LIBPROTOBUF_EXPORT ostream& operator<<(ostream& os, const Status& x); LIBPROTOBUF_EXPORT std::ostream& operator<<(std::ostream& os, const Status& x);
#define EXPECT_OK(value) EXPECT_TRUE((value).ok()) #define EXPECT_OK(value) EXPECT_TRUE((value).ok())
......
...@@ -137,7 +137,7 @@ const int kStringPrintfVectorMaxArgs = 32; ...@@ -137,7 +137,7 @@ const int kStringPrintfVectorMaxArgs = 32;
// and we can fix the problem or protect against an attack. // and we can fix the problem or protect against an attack.
static const char string_printf_empty_block[256] = { '\0' }; static const char string_printf_empty_block[256] = { '\0' };
string StringPrintfVector(const char* format, const vector<string>& v) { string StringPrintfVector(const char* format, const std::vector<string>& v) {
GOOGLE_CHECK_LE(v.size(), kStringPrintfVectorMaxArgs) GOOGLE_CHECK_LE(v.size(), kStringPrintfVectorMaxArgs)
<< "StringPrintfVector currently only supports up to " << "StringPrintfVector currently only supports up to "
<< kStringPrintfVectorMaxArgs << " arguments. " << kStringPrintfVectorMaxArgs << " arguments. "
......
...@@ -68,7 +68,7 @@ LIBPROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs; ...@@ -68,7 +68,7 @@ LIBPROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs;
// You can use this version when all your arguments are strings, but // You can use this version when all your arguments are strings, but
// you don't know how many arguments you'll have at compile time. // you don't know how many arguments you'll have at compile time.
// StringPrintfVector will LOG(FATAL) if v.size() > kStringPrintfVectorMaxArgs // StringPrintfVector will LOG(FATAL) if v.size() > kStringPrintfVectorMaxArgs
LIBPROTOBUF_EXPORT extern string StringPrintfVector(const char* format, const vector<string>& v); LIBPROTOBUF_EXPORT extern string StringPrintfVector(const char* format, const std::vector<string>& v);
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google
......
...@@ -226,8 +226,8 @@ void SplitStringToIteratorUsing(const string& full, ...@@ -226,8 +226,8 @@ void SplitStringToIteratorUsing(const string& full,
void SplitStringUsing(const string& full, void SplitStringUsing(const string& full,
const char* delim, const char* delim,
vector<string>* result) { std::vector<string>* result) {
std::back_insert_iterator< vector<string> > it(*result); std::back_insert_iterator< std::vector<string> > it(*result);
SplitStringToIteratorUsing(full, delim, it); SplitStringToIteratorUsing(full, delim, it);
} }
...@@ -264,8 +264,8 @@ void SplitStringToIteratorAllowEmpty(const StringType& full, ...@@ -264,8 +264,8 @@ void SplitStringToIteratorAllowEmpty(const StringType& full,
} }
void SplitStringAllowEmpty(const string& full, const char* delim, void SplitStringAllowEmpty(const string& full, const char* delim,
vector<string>* result) { std::vector<string>* result) {
std::back_insert_iterator<vector<string> > it(*result); std::back_insert_iterator<std::vector<string> > it(*result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it); SplitStringToIteratorAllowEmpty(full, delim, 0, it);
} }
...@@ -303,7 +303,7 @@ static void JoinStringsIterator(const ITERATOR& start, ...@@ -303,7 +303,7 @@ static void JoinStringsIterator(const ITERATOR& start,
} }
} }
void JoinStrings(const vector<string>& components, void JoinStrings(const std::vector<string>& components,
const char* delim, const char* delim,
string * result) { string * result) {
JoinStringsIterator(components.begin(), components.end(), delim, result); JoinStringsIterator(components.begin(), components.end(), delim, result);
...@@ -332,7 +332,7 @@ int UnescapeCEscapeSequences(const char* source, char* dest) { ...@@ -332,7 +332,7 @@ int UnescapeCEscapeSequences(const char* source, char* dest) {
} }
int UnescapeCEscapeSequences(const char* source, char* dest, int UnescapeCEscapeSequences(const char* source, char* dest,
vector<string> *errors) { std::vector<string> *errors) {
GOOGLE_DCHECK(errors == NULL) << "Error reporting not implemented."; GOOGLE_DCHECK(errors == NULL) << "Error reporting not implemented.";
char* d = dest; char* d = dest;
...@@ -468,7 +468,7 @@ int UnescapeCEscapeString(const string& src, string* dest) { ...@@ -468,7 +468,7 @@ int UnescapeCEscapeString(const string& src, string* dest) {
} }
int UnescapeCEscapeString(const string& src, string* dest, int UnescapeCEscapeString(const string& src, string* dest,
vector<string> *errors) { std::vector<string> *errors) {
scoped_array<char> unescaped(new char[src.size() + 1]); scoped_array<char> unescaped(new char[src.size() + 1]);
int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), errors); int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), errors);
GOOGLE_CHECK(dest); GOOGLE_CHECK(dest);
......
...@@ -213,7 +213,7 @@ LIBPROTOBUF_EXPORT string StringReplace(const string& s, const string& oldsub, ...@@ -213,7 +213,7 @@ LIBPROTOBUF_EXPORT string StringReplace(const string& s, const string& oldsub,
// over all of them. // over all of them.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim, LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim,
vector<string>* res); std::vector<string>* res);
// Split a string using one or more byte delimiters, presented // Split a string using one or more byte delimiters, presented
// as a nul-terminated c string. Append the components to 'result'. // as a nul-terminated c string. Append the components to 'result'.
...@@ -225,15 +225,15 @@ LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim, ...@@ -225,15 +225,15 @@ LIBPROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim,
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
LIBPROTOBUF_EXPORT void SplitStringAllowEmpty(const string& full, LIBPROTOBUF_EXPORT void SplitStringAllowEmpty(const string& full,
const char* delim, const char* delim,
vector<string>* result); std::vector<string>* result);
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Split() // Split()
// Split a string using a character delimiter. // Split a string using a character delimiter.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
inline vector<string> Split( inline std::vector<string> Split(
const string& full, const char* delim, bool skip_empty = true) { const string& full, const char* delim, bool skip_empty = true) {
vector<string> result; std::vector<string> result;
if (skip_empty) { if (skip_empty) {
SplitStringUsing(full, delim, &result); SplitStringUsing(full, delim, &result);
} else { } else {
...@@ -250,10 +250,10 @@ inline vector<string> Split( ...@@ -250,10 +250,10 @@ inline vector<string> Split(
// another takes a pointer to the target string. In the latter case the // another takes a pointer to the target string. In the latter case the
// target string is cleared and overwritten. // target string is cleared and overwritten.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
LIBPROTOBUF_EXPORT void JoinStrings(const vector<string>& components, LIBPROTOBUF_EXPORT void JoinStrings(const std::vector<string>& components,
const char* delim, string* result); const char* delim, string* result);
inline string JoinStrings(const vector<string>& components, inline string JoinStrings(const std::vector<string>& components,
const char* delim) { const char* delim) {
string result; string result;
JoinStrings(components, delim, &result); JoinStrings(components, delim, &result);
...@@ -285,15 +285,15 @@ inline string JoinStrings(const vector<string>& components, ...@@ -285,15 +285,15 @@ inline string JoinStrings(const vector<string>& components,
// //
// Errors: In the first form of the call, errors are reported with // Errors: In the first form of the call, errors are reported with
// LOG(ERROR). The same is true for the second form of the call if // LOG(ERROR). The same is true for the second form of the call if
// the pointer to the string vector is NULL; otherwise, error // the pointer to the string std::vector is NULL; otherwise, error
// messages are stored in the vector. In either case, the effect on // messages are stored in the std::vector. In either case, the effect on
// the dest array is not defined, but rest of the source will be // the dest array is not defined, but rest of the source will be
// processed. // processed.
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest); LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest);
LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest, LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest,
vector<string> *errors); std::vector<string> *errors);
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// UnescapeCEscapeString() // UnescapeCEscapeString()
...@@ -312,7 +312,7 @@ LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest, ...@@ -312,7 +312,7 @@ LIBPROTOBUF_EXPORT int UnescapeCEscapeSequences(const char* source, char* dest,
LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest); LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest);
LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest, LIBPROTOBUF_EXPORT int UnescapeCEscapeString(const string& src, string* dest,
vector<string> *errors); std::vector<string> *errors);
LIBPROTOBUF_EXPORT string UnescapeCEscapeString(const string& src); LIBPROTOBUF_EXPORT string UnescapeCEscapeString(const string& src);
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
......
...@@ -782,7 +782,7 @@ TEST(Base64, EscapeAndUnescape) { ...@@ -782,7 +782,7 @@ TEST(Base64, EscapeAndUnescape) {
reinterpret_cast<const unsigned char*>(base64_strings[i].plaintext); reinterpret_cast<const unsigned char*>(base64_strings[i].plaintext);
int plain_length = strlen(base64_strings[i].plaintext); int plain_length = strlen(base64_strings[i].plaintext);
int cypher_length = strlen(base64_strings[i].cyphertext); int cypher_length = strlen(base64_strings[i].cyphertext);
vector<char> buffer(cypher_length+1); std::vector<char> buffer(cypher_length+1);
int encode_length = WebSafeBase64Escape(unsigned_plaintext, int encode_length = WebSafeBase64Escape(unsigned_plaintext,
plain_length, plain_length,
&buffer[0], &buffer[0],
......
...@@ -253,7 +253,7 @@ TEST(TypeTraitsTest, TestIsPointer) { ...@@ -253,7 +253,7 @@ TEST(TypeTraitsTest, TestIsPointer) {
EXPECT_TRUE(is_pointer<const void* volatile>::value); EXPECT_TRUE(is_pointer<const void* volatile>::value);
EXPECT_TRUE(is_pointer<char** const volatile>::value); EXPECT_TRUE(is_pointer<char** const volatile>::value);
EXPECT_FALSE(is_pointer<const int>::value); EXPECT_FALSE(is_pointer<const int>::value);
EXPECT_FALSE(is_pointer<volatile vector<int*> >::value); EXPECT_FALSE(is_pointer<volatile std::vector<int*> >::value);
EXPECT_FALSE(is_pointer<const volatile double>::value); EXPECT_FALSE(is_pointer<const volatile double>::value);
} }
......
...@@ -263,7 +263,7 @@ ScopedMemoryLog::~ScopedMemoryLog() { ...@@ -263,7 +263,7 @@ ScopedMemoryLog::~ScopedMemoryLog() {
active_log_ = NULL; active_log_ = NULL;
} }
const vector<string>& ScopedMemoryLog::GetMessages(LogLevel level) { const std::vector<string>& ScopedMemoryLog::GetMessages(LogLevel level) {
GOOGLE_CHECK(level == ERROR || GOOGLE_CHECK(level == ERROR ||
level == WARNING); level == WARNING);
return messages_[level]; return messages_[level];
......
...@@ -83,10 +83,10 @@ class ScopedMemoryLog { ...@@ -83,10 +83,10 @@ class ScopedMemoryLog {
virtual ~ScopedMemoryLog(); virtual ~ScopedMemoryLog();
// Fetches all messages with the given severity level. // Fetches all messages with the given severity level.
const vector<string>& GetMessages(LogLevel error); const std::vector<string>& GetMessages(LogLevel error);
private: private:
std::map<LogLevel, vector<string> > messages_; std::map<LogLevel, std::vector<string> > messages_;
LogHandler* old_handler_; LogHandler* old_handler_;
static void HandleLog(LogLevel level, const char* filename, int line, static void HandleLog(LogLevel level, const char* filename, int line,
......
...@@ -12,7 +12,7 @@ bool SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_des ...@@ -12,7 +12,7 @@ bool SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_des
return SerializeDelimitedToZeroCopyStream(message, &output); return SerializeDelimitedToZeroCopyStream(message, &output);
} }
bool SerializeDelimitedToOstream(const MessageLite& message, ostream* output) { bool SerializeDelimitedToOstream(const MessageLite& message, std::ostream* output) {
{ {
io::OstreamOutputStream zero_copy_output(output); io::OstreamOutputStream zero_copy_output(output);
if (!SerializeDelimitedToZeroCopyStream(message, &zero_copy_output)) return false; if (!SerializeDelimitedToZeroCopyStream(message, &zero_copy_output)) return false;
......
...@@ -32,7 +32,7 @@ namespace util { ...@@ -32,7 +32,7 @@ namespace util {
// underlying source, so instead you must keep using the same stream object. // underlying source, so instead you must keep using the same stream object.
bool LIBPROTOBUF_EXPORT SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor); bool LIBPROTOBUF_EXPORT SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor);
bool LIBPROTOBUF_EXPORT SerializeDelimitedToOstream(const MessageLite& message, ostream* output); bool LIBPROTOBUF_EXPORT SerializeDelimitedToOstream(const MessageLite& message, std::ostream* output);
// Read a single size-delimited message from the given stream. Delimited // Read a single size-delimited message from the given stream. Delimited
// format allows a single file or stream to contain multiple messages, // format allows a single file or stream to contain multiple messages,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment