Crate vmf_forge

Source
Expand description

A library for parsing and manipulating Valve Map Format (VMF) files.

This library provides functionality to parse VMF files used in Source Engine games into Rust data structures, modify the data, and serialize it back into a VMF file.

§Example

use vmf_forge::prelude::*;
use std::fs::File;

fn main() -> Result<(), VmfError> {
    let mut file = File::open("vmf_examples/your_map.vmf")?;
    let vmf_file = VmfFile::parse_file(&mut file)?;

    println!("Map Version: {}", vmf_file.versioninfo.map_version);

    Ok(())
}

Re-exports§

pub use errors::VmfError;
pub use errors::VmfResult;
pub use vmf_file::VmfFile;

Modules§

errors
This module defines the error types used in the VMF parser using thiserror.
parser
This module provides the VMF parser implementation using the pest parsing library.
prelude
A prelude module that re-exports commonly used items from the vmf_forge crate.
vmf
This module contains the core data structures for representing VMF files, including the World, Entity, Solid, and other related types. It also re-exports the submodules common, entities, metadata, regions, and world.
vmf_file

Structs§

VmfBlock
Represents a block in a VMF file, which can contain key-value pairs and other blocks.

Traits§

VmfSerializable
A trait for types that can be serialized into a VMF string representation.