Lines Matching refs:StringPrintf
19 using base::StringPrintf;
39 return StringPrintf(param_def.is_const_ref ? "const %s& %s" : "%s* %s", in GetParamString()
53 text.AddLine(StringPrintf("// - %s", interface.name.c_str())); in GenerateProxies()
56 text.AddLine(StringPrintf("#ifndef %s", header_guard.c_str())); in GenerateProxies()
57 text.AddLine(StringPrintf("#define %s", header_guard.c_str())); in GenerateProxies()
84 text.AddLine(StringPrintf("class %s;", in GenerateProxies()
97 text.AddLine(StringPrintf("#endif // %s", header_guard.c_str())); in GenerateProxies()
111 text.AddLine(StringPrintf("// - %s", interface.name.c_str())); in GenerateMocks()
114 text.AddLine(StringPrintf("#ifndef %s", header_guard.c_str())); in GenerateMocks()
115 text.AddLine(StringPrintf("#define %s", header_guard.c_str())); in GenerateMocks()
169 text.AddLine(StringPrintf("#include \"%s\"", in GenerateMocks()
181 text.AddLine(StringPrintf("#endif // %s", header_guard.c_str())); in GenerateMocks()
197 text->AddLine(StringPrintf("// Abstract interface proxy for %s.", in GenerateInterfaceProxyInterface()
200 text->AddLine(StringPrintf("class %s {", base_interface_name.c_str())); in GenerateInterfaceProxyInterface()
204 StringPrintf("virtual ~%s() = default;", base_interface_name.c_str())); in GenerateInterfaceProxyInterface()
238 text->AddLine(StringPrintf("// Interface proxy for %s.", in GenerateInterfaceProxy()
241 text->AddLine(StringPrintf("class %s final : public %s {", in GenerateInterfaceProxy()
273 text->AddLine(StringPrintf("const std::string service_name_{\"%s\"};", in GenerateInterfaceProxy()
279 text->AddLine(StringPrintf("const dbus::ObjectPath object_path_{\"%s\"};", in GenerateInterfaceProxy()
285 StringPrintf("base::Callback<void(%sInterface*, const std::string&)> " in GenerateInterfaceProxy()
293 text->AddLine(StringPrintf( in GenerateInterfaceProxy()
297 text->AddLine(StringPrintf("DISALLOW_COPY_AND_ASSIGN(%s);", in GenerateInterfaceProxy()
321 text->AddLine(StringPrintf("// Mock object for %s.", in GenerateInterfaceMock()
323 text->AddLine(StringPrintf("class %s : public %s {", in GenerateInterfaceMock()
327 text->AddLine(StringPrintf("%s() = default;", mock_name.c_str())); in GenerateInterfaceMock()
344 text->AddLine(StringPrintf("MOCK_CONST_METHOD0(%s, %s());", in GenerateInterfaceMock()
347 text->AddLine(StringPrintf("MOCK_METHOD2(set_%s, void(%s, " in GenerateInterfaceMock()
357 text->AddLine(StringPrintf( in GenerateInterfaceMock()
366 text->AddLineWithOffset(StringPrintf("DISALLOW_COPY_AND_ASSIGN(%s);", in GenerateInterfaceMock()
390 block.AddLine(StringPrintf("%s(%s) :", class_name.c_str(), in AddConstructor()
393 block.AddLine(StringPrintf("%s(", class_name.c_str())); in AddConstructor()
396 block.AddLine(StringPrintf("%s,", GetParamString(args[i]).c_str())); in AddConstructor()
398 block.AddLine(StringPrintf("%s) :", GetParamString(args.back()).c_str())); in AddConstructor()
402 block.AddLine(StringPrintf("%s_{%s},", arg.name.c_str(), in AddConstructor()
421 block.AddLine(StringPrintf("~%s() override {", class_name.c_str())); in AddDestructor()
456 text->AddLine(StringPrintf("%svoid SetPropertyChangedCallback(", in AddPropertyPublicMethods()
459 StringPrintf("const base::Callback<void(%sInterface*, " in AddPropertyPublicMethods()
495 block.AddLine(StringPrintf("%svoid Register%sSignalHandler(", in AddSignalHandlerRegistration()
500 block.AddLine(StringPrintf( in AddSignalHandlerRegistration()
509 block.AddLine(StringPrintf("\"%s\",", interface_name.c_str())); in AddSignalHandlerRegistration()
510 block.AddLine(StringPrintf("\"%s\",", signal.name.c_str())); in AddSignalHandlerRegistration()
538 block.AddLine(StringPrintf("\"%s\",", interface.name.c_str())); in AddPropertySet()
545 StringPrintf("RegisterProperty(%sName(), &%s);", in AddPropertySet()
558 StringPrintf("brillo::dbus_utils::Property<%s> %s;", in AddPropertySet()
590 StringPrintf("static const char* %sName() { return \"%s\"; }", in AddProperties()
601 StringPrintf("%s%s %s() const%s", in AddProperties()
608 StringPrintf("return property_set_->%s.value();", name.c_str()), in AddProperties()
616 StringPrintf("%svoid set_%s(%s value,", in AddProperties()
622 StringPrintf("const base::Callback<void(bool)>& callback)%s", in AddProperties()
627 StringPrintf("property_set_->%s.Set(value, callback);", name.c_str()), in AddProperties()
644 block.AddLine(StringPrintf("%sbool %s(", in AddMethodProxy()
656 block.AddLine(StringPrintf( in AddMethodProxy()
665 block.AddLine(StringPrintf( in AddMethodProxy()
670 StringPrintf("int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)%s", in AddMethodProxy()
681 block.AddLine(StringPrintf("\"%s\",", interface_name.c_str())); in AddMethodProxy()
682 block.AddLine(StringPrintf("\"%s\",", method.name.c_str())); in AddMethodProxy()
685 block.AddLine(StringPrintf("%s,", last_argument.c_str())); in AddMethodProxy()
688 block.AddLine(StringPrintf("%s);", last_argument.c_str())); in AddMethodProxy()
711 block.AddLine(StringPrintf("%svoid %sAsync(", in AddAsyncMethodProxy()
723 block.AddLine(StringPrintf( in AddAsyncMethodProxy()
735 block.AddLine(StringPrintf( in AddAsyncMethodProxy()
741 StringPrintf("int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)%s", in AddAsyncMethodProxy()
751 block.AddLine(StringPrintf("\"%s\",", interface_name.c_str())); in AddAsyncMethodProxy()
752 block.AddLine(StringPrintf("\"%s\",", method.name.c_str())); in AddAsyncMethodProxy()
756 block.AddLine(StringPrintf("%s,", last_argument.c_str())); in AddAsyncMethodProxy()
759 block.AddLine(StringPrintf("%s);", last_argument.c_str())); in AddAsyncMethodProxy()
818 arguments.push_back(StringPrintf( in AddAsyncMethodMock()
836 StringPrintf("%s %s(%s,", in AddMockMethodDeclaration()
842 block.AddLine(StringPrintf("%s,", arguments[i].c_str())); in AddMockMethodDeclaration()
843 block.AddLine(StringPrintf("%s) override {", arguments.back().c_str())); in AddMockMethodDeclaration()
846 block.AddLine(StringPrintf( in AddMockMethodDeclaration()
862 StringPrintf("MOCK_METHOD%zu(%s,", in AddMockMethodDeclaration()
866 StringPrintf("%s(%s,", return_type.c_str(), arguments.front().c_str()), in AddMockMethodDeclaration()
869 block.AddLine(StringPrintf("%s,", arguments[i].c_str())); in AddMockMethodDeclaration()
870 block.AddLine(StringPrintf("%s));", arguments.back().c_str())); in AddMockMethodDeclaration()
887 StringPrintf("MOCK_METHOD2(Register%sSignalHandler,", in AddSignalHandlerRegistrationMock()
906 string signal_callback = StringPrintf("%ssignal_callback%s", in AddSignalCallbackArg()
910 block->AddLine(StringPrintf("const base::Closure& %s,", in AddSignalCallbackArg()
919 StringPrintf("%s%s,", prefix.c_str(), last_argument.c_str()), in AddSignalCallbackArg()
923 block->AddLine(StringPrintf("%s,", last_argument.c_str())); in AddSignalCallbackArg()
929 block->AddLine(StringPrintf("%s%s)>& %s,", in AddSignalCallbackArg()
952 text->AddLine(StringPrintf("class %s : " in GenerateProxy()
974 text->AddLine(StringPrintf("DISALLOW_COPY_AND_ASSIGN(%s);", in GenerateProxy()
990 StringPrintf("%s(const scoped_refptr<dbus::Bus>& bus,", in AddConstructor()
996 text->AddLine(StringPrintf("%s(const scoped_refptr<dbus::Bus>& bus)", in AddConstructor()
1010 text->AddLine(StringPrintf("\"%s\",", config.service_name.c_str())); in AddConstructor()
1012 text->AddLine(StringPrintf("dbus::ObjectPath{\"%s\"})} {", in AddConstructor()
1020 StringPrintf("dbus_object_manager_->RegisterInterface(\"%s\", this);", in AddConstructor()
1032 text->AddLine(StringPrintf("~%s() override {", class_name.c_str())); in AddDestructor()
1036 StringPrintf("dbus_object_manager_->UnregisterInterface(\"%s\");", in AddDestructor()
1061 text->AddLine(StringPrintf("%sInterface* Get%s(", in AddInterfaceAccessors()
1068 text->AddLine(StringPrintf("auto p = %s.find(object_path);", in AddInterfaceAccessors()
1070 text->AddLine(StringPrintf("if (p != %s.end())", map_name.c_str())); in AddInterfaceAccessors()
1080 text->AddLine(StringPrintf("%sInterface* Get%s() {", in AddInterfaceAccessors()
1084 text->AddLine(StringPrintf("if (%s.empty())", map_name.c_str())); in AddInterfaceAccessors()
1086 text->AddLine(StringPrintf("return %s.begin()->second.get();", in AddInterfaceAccessors()
1094 StringPrintf("std::vector<%sInterface*> Get%sInstances() const {", in AddInterfaceAccessors()
1098 text->AddLine(StringPrintf("std::vector<%sInterface*> values;", in AddInterfaceAccessors()
1100 text->AddLine(StringPrintf("values.reserve(%s.size());", map_name.c_str())); in AddInterfaceAccessors()
1101 text->AddLine(StringPrintf("for (const auto& pair : %s)", map_name.c_str())); in AddInterfaceAccessors()
1108 text->AddLine(StringPrintf("void Set%sAddedCallback(", in AddInterfaceAccessors()
1112 StringPrintf("const base::Callback<void(%sInterface*)>& callback) {", in AddInterfaceAccessors()
1116 text->AddLine(StringPrintf("on_%s_added_ = callback;", in AddInterfaceAccessors()
1122 text->AddLine(StringPrintf("void Set%sRemovedCallback(", in AddInterfaceAccessors()
1129 text->AddLine(StringPrintf("on_%s_removed_ = callback;", in AddInterfaceAccessors()
1168 text->AddLine(StringPrintf("if (interface_name == \"%s\") {", in AddOnPropertyChanged()
1172 text->AddLine(StringPrintf("auto p = %s.find(object_path);", in AddOnPropertyChanged()
1174 text->AddLine(StringPrintf("if (p == %s.end())", map_name.c_str())); in AddOnPropertyChanged()
1201 text->AddLine(StringPrintf("if (interface_name == \"%s\") {", in AddObjectAdded()
1207 text->AddLine(StringPrintf("static_cast<%s::PropertySet*>(", in AddObjectAdded()
1215 text->AddLine(StringPrintf("std::unique_ptr<%s> %s_proxy{", in AddObjectAdded()
1219 string new_instance = StringPrintf("new %s{bus_", in AddObjectAdded()
1232 text->AddLine(StringPrintf("auto p = %s_instances_.emplace(object_path, " in AddObjectAdded()
1235 text->AddLine(StringPrintf("if (!on_%s_added_.is_null())", in AddObjectAdded()
1238 text->AddLine(StringPrintf("on_%s_added_.Run(p.first->second.get());", in AddObjectAdded()
1262 text->AddLine(StringPrintf("if (interface_name == \"%s\") {", in AddObjectRemoved()
1265 text->AddLine(StringPrintf("auto p = %s_instances_.find(object_path);", in AddObjectRemoved()
1267 text->AddLine(StringPrintf("if (p != %s_instances_.end()) {", in AddObjectRemoved()
1270 text->AddLine(StringPrintf("if (!on_%s_removed_.is_null())", in AddObjectRemoved()
1273 text->AddLine(StringPrintf("on_%s_removed_.Run(object_path);", in AddObjectRemoved()
1276 text->AddLine(StringPrintf("%s_instances_.erase(p);", in AddObjectRemoved()
1302 text->AddLine(StringPrintf("if (interface_name == \"%s\") {", in AddCreateProperties()
1305 text->AddLine(StringPrintf("return new %s::PropertySet{", in AddCreateProperties()
1310 StringPrintf("base::Bind(&%s::OnPropertyChanged,", in AddCreateProperties()
1346 text->AddLine(StringPrintf("std::unique_ptr<%s>> %s_instances_;", in AddDataMembers()
1351 StringPrintf("base::Callback<void(%sInterface*)> on_%s_added_;", in AddDataMembers()
1354 text->AddLine(StringPrintf("base::Callback<void(const dbus::ObjectPath&)> " in AddDataMembers()
1359 StringPrintf("base::WeakPtrFactory<%s> weak_ptr_factory_{this};", in AddDataMembers()
1366 return StringPrintf("On%sSignal", signal.c_str()); in GetHandlerNameForSignal()