Lines Matching refs:file
52 virtual bool SerializeFile(FileReference* file, IArchiveWriter* writer) = 0;
95 bool SerializeFile(FileReference* file, IArchiveWriter* writer) override { in SerializeFile() argument
96 if (file->type == ResourceFile::Type::kProtoXml) { in SerializeFile()
97 unique_ptr<io::InputStream> in = file->file->OpenInputStream(); in SerializeFile()
100 << "failed to open file " << *file->path); in SerializeFile()
108 << "failed to parse proto XML " << *file->path); in SerializeFile()
117 << *file->path << ": " << error); in SerializeFile()
121 if (!SerializeXml(xml.get(), *file->path, false /*utf16*/, writer, in SerializeFile()
122 file->file->WasCompressed() ? ArchiveEntry::kCompress : 0u)) { in SerializeFile()
124 << "failed to serialize to binary XML: " << *file->path); in SerializeFile()
128 file->type = ResourceFile::Type::kBinaryXml; in SerializeFile()
130 if (!io::CopyFileToArchivePreserveCompression(context_, file->file, *file->path, writer)) { in SerializeFile()
132 << "failed to copy file " << *file->path); in SerializeFile()
166 bool SerializeFile(FileReference* file, IArchiveWriter* writer) override { in SerializeFile() argument
167 if (file->type == ResourceFile::Type::kBinaryXml) { in SerializeFile()
168 std::unique_ptr<io::IData> data = file->file->OpenAsData(); in SerializeFile()
171 << "failed to open file " << *file->path); in SerializeFile()
183 if (!SerializeXml(xml.get(), *file->path, false /*utf16*/, writer, in SerializeFile()
184 file->file->WasCompressed() ? ArchiveEntry::kCompress : 0u)) { in SerializeFile()
186 << "failed to serialize to proto XML: " << *file->path); in SerializeFile()
190 file->type = ResourceFile::Type::kProtoXml; in SerializeFile()
192 if (!io::CopyFileToArchivePreserveCompression(context_, file->file, *file->path, writer)) { in SerializeFile()
194 << "failed to copy file " << *file->path); in SerializeFile()
292 FileReference* file = ValueCast<FileReference>(config_value->value.get()); in Convert() local
293 if (file != nullptr) { in Convert()
294 if (file->file == nullptr) { in Convert()
296 << "no file associated with " << *file); in Convert()
301 if (files_written.insert(*file->path).second) { in Convert()
302 if (!serializer->SerializeFile(file, output_writer)) { in Convert()
304 << "failed to serialize file " << *file->path); in Convert()
325 io::IFile* file = iterator->Next(); in Convert() local
326 std::string path = file->GetSource().path; in Convert()
336 if (!io::CopyFileToArchivePreserveCompression(context, file, path, output_writer)) { in Convert()