Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/windows-result/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 910 B image not shown  

Quelle  bstr.rs

  Sprache: Rust
 

use super::*;
use core::ops::Deref;

#[repr(transparent)]
pub struct BasicString(*const u16);

impl Deref for BasicString {
    type Target = [u16];

    fn deref(&self) -> &[u16] {
        let len = if self.0.is_null() {
            0
        } else {
            unsafe { SysStringLen(self.0as usize }
        };

        if len > 0 {
            unsafe { core::slice::from_raw_parts(self.0, len) }
        } else {
            // This ensures that if `as_ptr` is called on the slice that the resulting pointer
            // will still refer to a null-terminated string.
            const EMPTY: [u16; 1] = [0];
            &EMPTY[..0]
        }
    }
}

impl Default for BasicString {
    fn default() -> Self {
        Self(core::ptr::null_mut())
    }
}

impl Drop for BasicString {
    fn drop(&mut self) {
        if !self.0.is_null() {
            unsafe { SysFreeString(self.0) }
        }
    }
}

Messung V0.5 in Prozent
C=95 H=99 G=96

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© 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.