Home
last modified time | relevance | path

Searched refs:writer (Results 1 – 25 of 90) sorted by relevance

1234

/system/tools/aidl/
Daidl_to_java.cpp197 c.writer << c.parcel << ".writeInt(((" << c.var << ")?(1):(0)));\n"; in WriteToParcelFor()
201 c.writer << c.parcel << ".writeBooleanArray(" << c.var << ");\n"; in WriteToParcelFor()
205 c.writer << c.parcel << ".writeByte(" << c.var << ");\n"; in WriteToParcelFor()
209 c.writer << c.parcel << ".writeByteArray(" << c.var << ");\n"; in WriteToParcelFor()
213 c.writer << c.parcel << ".writeInt(((int)" << c.var << "));\n"; in WriteToParcelFor()
217 c.writer << c.parcel << ".writeCharArray(" << c.var << ");\n"; in WriteToParcelFor()
221 c.writer << c.parcel << ".writeInt(" << c.var << ");\n"; in WriteToParcelFor()
225 c.writer << c.parcel << ".writeIntArray(" << c.var << ");\n"; in WriteToParcelFor()
229 c.writer << c.parcel << ".writeLong(" << c.var << ");\n"; in WriteToParcelFor()
233 c.writer << c.parcel << ".writeLongArray(" << c.var << ");\n"; in WriteToParcelFor()
[all …]
Daidl_to_cpp_common.cpp190 void WriteLogFor(CodeWriter& writer, const AidlTypeSpecifier& type, const std::string& name, in WriteLogFor() argument
199 writer << log << " = Json::Value(Json::arrayValue);\n"; in WriteLogFor()
200 writer << "for (const auto& v: " << var_object_expr << ") " << log << ".append("; in WriteLogFor()
201 info.toJsonValueExpr(writer, "v", isNdk); in WriteLogFor()
202 writer << ");"; in WriteLogFor()
204 writer << log << " = "; in WriteLogFor()
205 info.toJsonValueExpr(writer, var_object_expr, isNdk); in WriteLogFor()
206 writer << ";"; in WriteLogFor()
208 writer << "\n"; in WriteLogFor()
211 void WriteLogForArguments(CodeWriterPtr& writer, const AidlArgument& a, bool isServer, in WriteLogForArguments() argument
[all …]
Dcode_writer_unittest.cpp32 CodeWriter& writer = *ptr; in TEST() local
33 writer << "Write this"; in TEST()
34 writer.Close(); in TEST()
41 CodeWriter& writer = *ptr; in TEST() local
42 writer << "Write this " << "and that"; in TEST()
43 writer.Close(); in TEST()
/system/tools/sysprop/
DCppGen.cpp252 CodeWriter writer(kIndent); in GenerateHeader() local
254 writer.Write("%s", kGeneratedFileFooterComments); in GenerateHeader()
256 writer.Write("#pragma once\n\n"); in GenerateHeader()
257 writer.Write("%s", kCppHeaderIncludes); in GenerateHeader()
260 writer.Write("namespace %s {\n\n", cpp_namespace.c_str()); in GenerateHeader()
271 writer.Write("\n"); in GenerateHeader()
280 writer.Write("enum class %s {\n", GetCppEnumName(prop).c_str()); in GenerateHeader()
281 writer.Indent(); in GenerateHeader()
284 writer.Write("%s,\n", ToUpper(name).c_str()); in GenerateHeader()
286 writer.Dedent(); in GenerateHeader()
[all …]
DJavaGen.cpp296 CodeWriter writer(kIndent); in GenerateJavaClass() local
297 writer.Write("%s", kGeneratedFileFooterComments); in GenerateJavaClass()
298 writer.Write("package %s;\n\n", package_name.c_str()); in GenerateJavaClass()
299 writer.Write("%s", kJavaFileImports); in GenerateJavaClass()
300 writer.Write("public final class %s {\n", class_name.c_str()); in GenerateJavaClass()
301 writer.Indent(); in GenerateJavaClass()
302 writer.Write("private %s () {}\n\n", class_name.c_str()); in GenerateJavaClass()
303 writer.Write("%s", kJavaParsersAndFormatters); in GenerateJavaClass()
311 writer.Write("\n"); in GenerateJavaClass()
317 writer.Write("public static enum %s {\n", in GenerateJavaClass()
[all …]
/system/core/libziparchive/
Dzip_writer_test.cc49 ZipWriter writer(file_); in TEST_F() local
53 ASSERT_EQ(0, writer.StartEntry("file.txt", 0)); in TEST_F()
54 ASSERT_EQ(0, writer.WriteBytes("he", 2)); in TEST_F()
55 ASSERT_EQ(0, writer.WriteBytes("llo", 3)); in TEST_F()
56 ASSERT_EQ(0, writer.FinishEntry()); in TEST_F()
57 ASSERT_EQ(0, writer.Finish()); in TEST_F()
76 ZipWriter writer(file_); in TEST_F() local
78 ASSERT_EQ(0, writer.StartEntry("file.txt", 0)); in TEST_F()
79 ASSERT_EQ(0, writer.WriteBytes("he", 2)); in TEST_F()
80 ASSERT_EQ(0, writer.FinishEntry()); in TEST_F()
[all …]
Dzip_archive_benchmark.cpp34 ZipWriter writer(fp); in CreateZip() local
39 writer.StartEntry(lastName.c_str(), ZipWriter::kCompress); in CreateZip()
41 writer.WriteBytes("helo", 4); in CreateZip()
44 writer.FinishEntry(); in CreateZip()
46 writer.Finish(); in CreateZip()
93 ZipWriter writer(fp); in StartAlignedEntry() local
99 writer.StartAlignedEntry(name + std::to_string(counter++), 0, alignment); in StartAlignedEntry()
101 writer.WriteBytes("hola", 4); in StartAlignedEntry()
102 writer.FinishEntry(); in StartAlignedEntry()
106 writer.Finish(); in StartAlignedEntry()
/system/tools/sysprop/tests/
DCodeWriterUnitTest.cpp39 CodeWriter writer(kIndent); in TEST() local
40 writer.Write("test1\ntest2\n"); in TEST()
41 writer.Indent(); in TEST()
42 writer.Write("test3\ntest4\n"); in TEST()
43 writer.Indent(); in TEST()
44 writer.Write("test5\ntest6\n"); in TEST()
45 writer.Dedent(); in TEST()
46 writer.Dedent(); in TEST()
47 writer.Write("test7\ntest8\n"); in TEST()
49 ASSERT_EQ(writer.Code(), in TEST()
[all …]
/system/libufdt/utils/src/
Dmkdtimg_core.c243 struct dt_image_writer *writer = NULL; in dt_image_writer_start() local
246 writer = malloc(sizeof(struct dt_image_writer)); in dt_image_writer_start()
247 if (!writer) goto error; in dt_image_writer_start()
252 writer->img_fp = img_fp; in dt_image_writer_start()
253 init_dt_global_options(&writer->global_options); in dt_image_writer_start()
254 init_dt_options(&writer->entry_options); in dt_image_writer_start()
255 writer->entry_filename[0] = '\0'; in dt_image_writer_start()
256 writer->entry_count = entry_count; in dt_image_writer_start()
257 writer->entry_offset = sizeof(struct dt_table_header); in dt_image_writer_start()
258 writer->dt_offset = in dt_image_writer_start()
[all …]
Dmkdtimg_create.c58 struct dt_image_writer *writer = dt_image_writer_start(img_fp, entry_count); in output_img_with_args() local
72 if (dt_image_writer_add_entry(writer, arg) != 0) { in output_img_with_args()
80 set_entry_options(writer, option, value) : in output_img_with_args()
81 set_global_options(writer, option, value); in output_img_with_args()
88 if (dt_image_writer_end(writer) != 0) { in output_img_with_args()
/system/linkerconfig/modules/tests/
Dnamespace_test.cc89 ConfigWriter writer; in TEST() local
91 ns.WriteConfig(writer); in TEST()
92 auto config = writer.ToString(); in TEST()
98 ConfigWriter writer; in TEST() local
102 ns.WriteConfig(writer); in TEST()
103 auto config = writer.ToString(); in TEST()
109 ConfigWriter writer; in TEST() local
113 ns.WriteConfig(writer); in TEST()
115 auto config = writer.ToString(); in TEST()
128 ConfigWriter writer; in TEST() local
[all …]
Dconfigwriter_test.cc25 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
27 writer.WriteLine(kSampleContent); in TEST()
29 ASSERT_EQ(writer.ToString(), "Lorem ipsum dolor sit amet\n"); in TEST()
33 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
35 writer.WriteVars("var1", {"value1", "value2"}); in TEST()
36 writer.WriteVars("var2", {"value1"}); in TEST()
37 writer.WriteVars("var3", {}); in TEST()
43 writer.ToString()); in TEST()
Dlink_test.cc29 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
35 link->WriteConfig(writer); in TEST()
36 auto config_text = writer.ToString(); in TEST()
44 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
49 link->WriteConfig(writer); in TEST()
50 auto config_text = writer.ToString(); in TEST()
Dsection_test.cc103 ConfigWriter writer; in TEST() local
115 section.WriteConfig(writer); in TEST()
116 auto config = writer.ToString(); in TEST()
121 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
127 section.WriteConfig(writer); in TEST()
128 auto config = writer.ToString(); in TEST()
146 ConfigWriter writer; in TEST() local
147 section.WriteConfig(writer); in TEST()
159 writer.ToString()); in TEST()
204 ConfigWriter writer; in TEST() local
[all …]
/system/timezone/input_tools/android/tzlookup_generator/src/main/java/com/android/libcore/timezone/tzlookup/
DTzLookupFile.java91 StringWriter writer = new StringWriter(); in write() local
92 writeRaw(timeZones, writer); in write()
93 String rawXml = writer.getBuffer().toString(); in write()
134 static void writeXml(TimeZones timeZones, XMLStreamWriter writer) in writeXml() argument
136 writer.writeStartElement(TIMEZONES_ELEMENT); in writeXml()
137 writer.writeAttribute(IANA_VERSION_ATTRIBUTE, timeZones.ianaVersion); in writeXml()
138 CountryZones.writeXml(timeZones.countryZones, writer); in writeXml()
139 writer.writeEndElement(); in writeXml()
150 static void writeXml(CountryZones countryZones, XMLStreamWriter writer) in writeXml() argument
152 writer.writeStartElement(COUNTRY_ZONES_ELEMENT); in writeXml()
[all …]
/system/extras/simpleperf/
Drecord_file_test.cpp56 std::unique_ptr<RecordFileWriter> writer = RecordFileWriter::CreateInstance(tmpfile_.path); in TEST_F() local
57 ASSERT_TRUE(writer != nullptr); in TEST_F()
61 ASSERT_TRUE(writer->WriteAttrSection(attr_ids_)); in TEST_F()
66 ASSERT_TRUE(writer->WriteRecord(mmap_record)); in TEST_F()
69 ASSERT_TRUE(writer->BeginWriteFeatures(1)); in TEST_F()
77 ASSERT_TRUE(writer->WriteBuildIdFeature(build_id_records)); in TEST_F()
78 ASSERT_TRUE(writer->EndWriteFeatures()); in TEST_F()
79 ASSERT_TRUE(writer->Close()); in TEST_F()
104 std::unique_ptr<RecordFileWriter> writer = RecordFileWriter::CreateInstance(tmpfile_.path); in TEST_F() local
105 ASSERT_TRUE(writer != nullptr); in TEST_F()
[all …]
/system/timezone/input_tools/android/telephonylookup_generator/src/main/java/com/android/libcore/timezone/telephonylookup/
DTelephonyLookupXmlFile.java68 StringWriter writer = new StringWriter(); in write() local
69 writeRaw(telephonyLookup, writer); in write()
70 String rawXml = writer.getBuffer().toString(); in write()
105 static void writeXml(TelephonyLookup telephonyLookup, XMLStreamWriter writer) in writeXml() argument
107 writer.writeStartElement(TELEPHONY_LOOKUP_ELEMENT); in writeXml()
108 writer.writeStartElement(NETWORKS_ELEMENT); in writeXml()
110 network.writeXml(network, writer); in writeXml()
112 writer.writeEndElement(); // NETWORKS_ELEMENT in writeXml()
113 writer.writeEndElement(); // TELEPHONY_LOOKUP_ELEMENT in writeXml()
129 static void writeXml(Network network, XMLStreamWriter writer) in writeXml() argument
[all …]
/system/nvram/messages/
Dmessage_codec.cpp30 ProtoWriter* writer, in Encode() argument
34 return encoder.Encode(writer); in Encode()
39 ProtoWriter writer(&counting_stream); in GetSize() local
40 return EncodeData(&writer) ? counting_stream.bytes_written() : 0; in GetSize()
43 bool MessageEncoderBase::Encode(ProtoWriter* writer) { in Encode() argument
67 return writer->WriteLengthHeader(GetSize()) && EncodeData(writer); in Encode()
70 bool MessageEncoderBase::EncodeData(ProtoWriter* writer) { in EncodeData() argument
73 writer->set_field_number(desc.field_number); in EncodeData()
74 if (!desc.encode_function(object_, writer)) { in EncodeData()
/system/nvram/messages/include/nvram/messages/
Dproto.hpp134 NVRAM_NOINLINE bool EncodeField(const Type& value, ProtoWriter* writer) { in EncodeField() argument
135 return Codec::Encode(value, writer); in EncodeField()
153 static bool Encode(const Blob& blob, ProtoWriter* writer) { in Encode()
154 return writer->WriteLengthDelimited(blob.data(), blob.size()); in Encode()
189 static bool Encode(const Type& value, ProtoWriter* writer) { in Encode()
190 return writer->WriteVarint(static_cast<uint64_t>(value)); in Encode()
209 static bool Encode(const Vector<ElementType>& vector, ProtoWriter* writer) { in Encode()
211 if (!EncodeField<ElementCodec>(elem, writer)) { in Encode()
230 static bool Encode(const Optional<ValueType>& value, ProtoWriter* writer) { in Encode()
231 return !value.valid() || EncodeField<ValueCodec>(value.value(), writer); in Encode()
[all …]
Dmessage_codec.h38 using EncodeFunction = bool(const void* object, ProtoWriter* writer);
73 ProtoWriter* writer,
82 bool Encode(ProtoWriter* writer);
85 bool EncodeData(ProtoWriter* writer);
/system/linkerconfig/modules/
Dnamespace.cc62 void Namespace::WriteConfig(ConfigWriter& writer) { in WriteConfig() argument
65 writer.WriteLine(prefix + "isolated = " + (is_isolated_ ? "true" : "false")); in WriteConfig()
68 writer.WriteLine(prefix + "visible = true"); in WriteConfig()
71 writer.WriteVars(prefix + "search.paths", search_paths_); in WriteConfig()
72 writer.WriteVars(prefix + "permitted.paths", permitted_paths_); in WriteConfig()
73 writer.WriteVars(prefix + "asan.search.paths", asan_search_paths_); in WriteConfig()
74 writer.WriteVars(prefix + "asan.permitted.paths", asan_permitted_paths_); in WriteConfig()
75 writer.WriteVars(prefix + "whitelisted", whitelisted_); in WriteConfig()
83 writer.WriteLine(prefix + "links = " + android::base::Join(link_list, ",")); in WriteConfig()
86 link.WriteConfig(writer); in WriteConfig()
Dlink.cc38 void Link::WriteConfig(ConfigWriter& writer) const { in WriteConfig()
42 writer.WriteLine(prefix + "allow_all_shared_libs = true"); in WriteConfig()
44 writer.WriteVars(prefix + "shared_libs", shared_libs_); in WriteConfig()
Dconfiguration.cc27 void Configuration::WriteConfig(ConfigWriter& writer) { in WriteConfig() argument
38 writer.WriteLine("dir." + section + " = " + dir); in WriteConfig()
43 section.WriteConfig(writer); in WriteConfig()
/system/update_engine/payload_consumer/
Dfile_descriptor_utils.cc40 DirectExtentWriter* writer, in CommonHashExtents() argument
61 if (writer) { in CommonHashExtents()
63 writer->Write(buf.data(), read_blocks * block_size)); in CommonHashExtents()
85 DirectExtentWriter writer; in CopyAndHashExtents() local
86 TEST_AND_RETURN_FALSE(writer.Init(target, tgt_extents, block_size)); in CopyAndHashExtents()
90 CommonHashExtents(source, src_extents, &writer, block_size, hash_out)); in CopyAndHashExtents()
/system/update_engine/payload_generator/
Dpayload_file.cc55 bool WriteUint64AsBigEndian(FileWriter* writer, const uint64_t value) { in WriteUint64AsBigEndian() argument
57 TEST_AND_RETURN_FALSE(writer->Write(&value_be, sizeof(value_be))); in WriteUint64AsBigEndian()
216 DirectFileWriter writer; in WritePayload() local
217 TEST_AND_RETURN_FALSE_ERRNO(writer.Open(payload_file.c_str(), in WritePayload()
220 ScopedFileWriterCloser writer_closer(&writer); in WritePayload()
223 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(kDeltaMagic, sizeof(kDeltaMagic))); in WritePayload()
226 TEST_AND_RETURN_FALSE(WriteUint64AsBigEndian(&writer, major_version_)); in WritePayload()
230 WriteUint64AsBigEndian(&writer, serialized_manifest.size())); in WritePayload()
238 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(&metadata_signature_size, in WritePayload()
249 writer.Write(serialized_manifest.data(), serialized_manifest.size())); in WritePayload()
[all …]

1234