Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  zip.rs

  Sprache: Rust
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


//! Zip utilities related to localization packaging.

use crate::std::{fs::File, io::Read, path::Path};
use anyhow::{Context, Result};
use zip::read::{ArchiveOffset, Config as ZipConfig, ZipArchive};

/// A firefox archive file.
pub type Archive = ZipArchive<File>;

/// Read a zip file.
pub fn read_zip(path: &Path) -> Result<Archive> {
    ZipArchive::with_config(
        ZipConfig {
            // The archive starts at the beginning of the file (it's a standard zip file, no
            // prefix data).
            //
            // Without this explicit offset, the default behavior will not work for omnijar files
            // (which have the central directory at the beginning of the file, rather than just
            // before the end of central directory maker).
            archive_offset: ArchiveOffset::Known(0),
        },
        File::open(&path).with_context(|| format!("failed to open {}", path.display()))?,
    )
    .with_context(|| format!("failed to read zip archive in {}", path.display()))
}

/// Read a file from the given zip archive as a string.
pub fn read_archive_file_as_string(archive: &mut Archive, path: &str)&nbsp;-> anyhow::Result<String> {
    let mut file = archive
        .by_name(path)
        .with_context(|| format!("failed to locate {path} in archive"))?;
    let mut data = String::new();
    file.read_to_string(&mut data)
        .with_context(|| format!("failed to read {path} from archive"))?;
    Ok(data)
}

Messung V0.5 in Prozent
C=74 H=100 G=87

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-08-24) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002