Home
last modified time | relevance | path

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

12345

/system/tools/aidl/
Daidl_to_java.cpp208 c.writer << c.parcel << ".writeInt(((" << c.var << ")?(1):(0)));\n"; in WriteToParcelFor()
212 c.writer << c.parcel << ".writeBooleanArray(" << c.var << ");\n"; in WriteToParcelFor()
216 c.writer << c.parcel << ".writeByte(" << c.var << ");\n"; in WriteToParcelFor()
220 c.writer << c.parcel << ".writeByteArray(" << c.var << ");\n"; in WriteToParcelFor()
224 c.writer << c.parcel << ".writeInt(((int)" << c.var << "));\n"; in WriteToParcelFor()
228 c.writer << c.parcel << ".writeCharArray(" << c.var << ");\n"; in WriteToParcelFor()
232 c.writer << c.parcel << ".writeInt(" << c.var << ");\n"; in WriteToParcelFor()
236 c.writer << c.parcel << ".writeIntArray(" << c.var << ");\n"; in WriteToParcelFor()
240 c.writer << c.parcel << ".writeLong(" << c.var << ");\n"; in WriteToParcelFor()
244 c.writer << c.parcel << ".writeLongArray(" << c.var << ");\n"; in WriteToParcelFor()
[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()
53 CodeWriter& writer = *ptr; in TEST() local
54 writer << "가"; in TEST()
55 writer.Close(); in TEST()
Daidl_to_cpp_common.cpp126 CodeWriterPtr writer = CodeWriter::ForString(&code); in GenLogBeforeExecute() local
127 (*writer) << className << "::TransactionLog _transaction_log;\n"; in GenLogBeforeExecute()
129 (*writer) << "if (" << className << "::logFunc != nullptr) {\n"; in GenLogBeforeExecute()
130 (*writer).Indent(); in GenLogBeforeExecute()
133 WriteLogForArgument(*writer, *a, isServer, "_transaction_log.input_args", isNdk); in GenLogBeforeExecute()
136 (*writer).Dedent(); in GenLogBeforeExecute()
137 (*writer) << "}\n"; in GenLogBeforeExecute()
139 (*writer) << "auto _log_start = std::chrono::steady_clock::now();\n"; in GenLogBeforeExecute()
140 writer->Close(); in GenLogBeforeExecute()
148 CodeWriterPtr writer = CodeWriter::ForString(&code); in GenLogAfterExecute() local
[all …]
/system/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()
Dlibziparchive_writer_fuzzer.cpp20 ZipWriter writer(fp.get()); in LLVMFuzzerTestOneInput() local
26 if (writer.StartEntry(path, path.size()) == 0) { in LLVMFuzzerTestOneInput()
34 writer.WriteBytes(next_buf.data(), next_buf.size()); in LLVMFuzzerTestOneInput()
36 writer.FinishEntry(); in LLVMFuzzerTestOneInput()
39 writer.Finish(); in LLVMFuzzerTestOneInput()
/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/tools/sysprop/
DJavaGen.cpp359 CodeWriter writer(kIndent); in GenerateJavaClass() local
360 writer.Write("%s", kGeneratedFileFooterComments); in GenerateJavaClass()
361 writer.Write("package %s;\n\n", package_name.c_str()); in GenerateJavaClass()
362 writer.Write("%s", kJavaFileImports); in GenerateJavaClass()
363 writer.Write("public final class %s {\n", class_name.c_str()); in GenerateJavaClass()
364 writer.Indent(); in GenerateJavaClass()
365 writer.Write("private %s () {}\n\n", class_name.c_str()); in GenerateJavaClass()
366 writer.Write("%s", kJavaParsersAndFormatters); in GenerateJavaClass()
374 writer.Write("\n"); in GenerateJavaClass()
380 writer.Write("public static enum %s {\n", in GenerateJavaClass()
[all …]
/system/core/fs_mgr/libsnapshot/
Dcow_api_test.cpp68 CowWriter writer(options); in TEST_F() local
70 ASSERT_TRUE(writer.Initialize(cow_->fd)); in TEST_F()
75 ASSERT_TRUE(writer.AddCopy(10, 20)); in TEST_F()
76 ASSERT_TRUE(writer.AddRawBlocks(50, data.data(), data.size())); in TEST_F()
77 ASSERT_TRUE(writer.AddZeroBlocks(51, 2)); in TEST_F()
78 ASSERT_TRUE(writer.Finalize()); in TEST_F()
147 CowWriter writer(options); in TEST_F() local
149 ASSERT_TRUE(writer.Initialize(cow_->fd)); in TEST_F()
154 ASSERT_TRUE(writer.AddRawBlocks(50, data.data(), data.size())); in TEST_F()
155 ASSERT_TRUE(writer.Finalize()); in TEST_F()
[all …]
Dsnapshot_reader_test.cpp64 void WriteCow(ISnapshotWriter* writer) { in WriteCow() argument
67 ASSERT_TRUE(writer->AddCopy(3, 0)); in WriteCow()
68 ASSERT_TRUE(writer->AddRawBlocks(5, new_block.data(), new_block.size())); in WriteCow()
69 ASSERT_TRUE(writer->AddZeroBlocks(7, 2)); in WriteCow()
70 ASSERT_TRUE(writer->Finalize()); in WriteCow()
73 void TestBlockReads(ISnapshotWriter* writer) { in TestBlockReads() argument
74 auto reader = writer->OpenReader(); in TestBlockReads()
107 void TestByteReads(ISnapshotWriter* writer) { in TestByteReads() argument
108 auto reader = writer->OpenReader(); in TestByteReads()
132 void TestReads(ISnapshotWriter* writer) { in TestReads() argument
[all …]
Dcow_snapuserd_test.cpp315 CowWriter writer(options); in CreateCowDeviceWithCopyOverlap_2() local
317 ASSERT_TRUE(writer.Initialize(cow_system_->fd)); in CreateCowDeviceWithCopyOverlap_2()
325 ASSERT_TRUE(writer.AddCopy(blk_src_copy, blk_src_copy + 1)); in CreateCowDeviceWithCopyOverlap_2()
334 ASSERT_TRUE(writer.Finalize()); in CreateCowDeviceWithCopyOverlap_2()
367 CowWriter writer(options); in CreateCowDeviceWithCopyOverlap_1() local
369 ASSERT_TRUE(writer.Initialize(cow_system_->fd)); in CreateCowDeviceWithCopyOverlap_1()
377 ASSERT_TRUE(writer.AddCopy(blk_src_copy + 1, blk_src_copy)); in CreateCowDeviceWithCopyOverlap_1()
387 ASSERT_TRUE(writer.Finalize()); in CreateCowDeviceWithCopyOverlap_1()
426 CowWriter writer(options); in CreateCowDeviceOrderedOpsInverted() local
428 ASSERT_TRUE(writer.Initialize(cow_system_->fd)); in CreateCowDeviceOrderedOpsInverted()
[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.cc83 ConfigWriter writer; in TEST() local
85 ns.WriteConfig(writer); in TEST()
86 auto config = writer.ToString(); in TEST()
92 ConfigWriter writer; in TEST() local
96 ns.WriteConfig(writer); in TEST()
97 auto config = writer.ToString(); in TEST()
103 ConfigWriter writer; in TEST() local
107 ns.WriteConfig(writer); in TEST()
109 auto config = writer.ToString(); in TEST()
122 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.cc95 ConfigWriter writer; in TEST() local
107 section.WriteConfig(writer); in TEST()
108 auto config = writer.ToString(); in TEST()
113 android::linkerconfig::modules::ConfigWriter writer; in TEST() local
119 section.WriteConfig(writer); in TEST()
120 auto config = writer.ToString(); in TEST()
138 ConfigWriter writer; in TEST() local
139 section.WriteConfig(writer); in TEST()
151 writer.ToString()); in TEST()
196 ConfigWriter writer; in TEST() local
[all …]
/system/extras/simpleperf/
Drecord_file_test.cpp60 std::unique_ptr<RecordFileWriter> writer = RecordFileWriter::CreateInstance(tmpfile_.path); in TEST_F() local
61 ASSERT_TRUE(writer != nullptr); in TEST_F()
65 ASSERT_TRUE(writer->WriteAttrSection(attr_ids_)); in TEST_F()
70 ASSERT_TRUE(writer->WriteRecord(mmap_record)); in TEST_F()
73 ASSERT_TRUE(writer->BeginWriteFeatures(1)); in TEST_F()
81 ASSERT_TRUE(writer->WriteBuildIdFeature(build_id_records)); in TEST_F()
82 ASSERT_TRUE(writer->EndWriteFeatures()); in TEST_F()
83 ASSERT_TRUE(writer->Close()); in TEST_F()
108 std::unique_ptr<RecordFileWriter> writer = RecordFileWriter::CreateInstance(tmpfile_.path); in TEST_F() local
109 ASSERT_TRUE(writer != nullptr); in TEST_F()
[all …]
/system/timezone/input_tools/android/tzlookup_generator/src/main/java/com/android/libcore/timezone/tzlookup/
DTzLookupFile.java95 StringWriter writer = new StringWriter(); in write() local
96 writeRaw(timeZones, writer); in write()
97 String rawXml = writer.getBuffer().toString(); in write()
138 static void writeXml(TimeZones timeZones, XMLStreamWriter writer) in writeXml() argument
140 writer.writeStartElement(TIMEZONES_ELEMENT); in writeXml()
141 writer.writeAttribute(IANA_VERSION_ATTRIBUTE, timeZones.ianaVersion); in writeXml()
142 CountryZones.writeXml(timeZones.countryZones, writer); in writeXml()
143 writer.writeEndElement(); in writeXml()
154 static void writeXml(CountryZones countryZones, XMLStreamWriter writer) in writeXml() argument
156 writer.writeStartElement(COUNTRY_ZONES_ELEMENT); in writeXml()
[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 …]
/system/linkerconfig/modules/
Dnamespace.cc79 void Namespace::WriteConfig(ConfigWriter& writer) { in WriteConfig() argument
89 writer.WriteLine(prefix + "isolated = " + (is_isolated_ ? "true" : "false")); in WriteConfig()
92 writer.WriteLine(prefix + "visible = true"); in WriteConfig()
95 writer.WriteVars(prefix + "search.paths", search_paths_); in WriteConfig()
96 writer.WriteVars(prefix + "permitted.paths", permitted_paths_); in WriteConfig()
97 writer.WriteVars(prefix + "asan.search.paths", asan_search_paths_); in WriteConfig()
98 writer.WriteVars(prefix + "asan.permitted.paths", asan_permitted_paths_); in WriteConfig()
99 writer.WriteVars(prefix + "allowed_libs", allowed_libs_); in WriteConfig()
108 writer.WriteLine(prefix + "links = " + android::base::Join(link_list, ",")); in WriteConfig()
111 link.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{target}; in CopyAndHashExtents() local
86 TEST_AND_RETURN_FALSE(writer.Init(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.cc56 bool WriteUint64AsBigEndian(FileWriter* writer, const uint64_t value) { in WriteUint64AsBigEndian() argument
58 TEST_AND_RETURN_FALSE(writer->Write(&value_be, sizeof(value_be))); in WriteUint64AsBigEndian()
207 DirectFileWriter writer; in WritePayload() local
208 TEST_AND_RETURN_FALSE_ERRNO(writer.Open(payload_file.c_str(), in WritePayload()
211 ScopedFileWriterCloser writer_closer(&writer); in WritePayload()
214 TEST_AND_RETURN_FALSE_ERRNO(writer.Write(kDeltaMagic, sizeof(kDeltaMagic))); in WritePayload()
217 TEST_AND_RETURN_FALSE(WriteUint64AsBigEndian(&writer, major_version_)); in WritePayload()
221 WriteUint64AsBigEndian(&writer, serialized_manifest.size())); in WritePayload()
227 writer.Write(&metadata_signature_size, sizeof(metadata_signature_size))); in WritePayload()
236 writer.Write(serialized_manifest.data(), serialized_manifest.size())); in WritePayload()
[all …]

12345