Skip to main content

azul_css/codegen/
cpp.rs

1//! C++ backend stub. Returns a single placeholder source file noting that the
2//! emitter is not implemented; the dispatch path in [`super::backend_for`] is
3//! still wired so `?lang=cpp` produces a structured response instead of a 404.
4
5use alloc::{string::String, string::ToString, vec, vec::Vec};
6
7use super::{CodegenBackend, GeneratedFile};
8use crate::css::Css;
9
10pub struct CppBackend;
11
12impl CodegenBackend for CppBackend {
13    fn lang(&self) -> &'static str {
14        "cpp"
15    }
16
17    fn emit_css(&self, _css: &Css) -> String {
18        "// TODO: C++ codegen backend not yet implemented.\n".to_string()
19    }
20
21    fn emit_project(&self, css: &Css) -> Vec<GeneratedFile> {
22        vec![GeneratedFile {
23            path: "main.cpp".to_string(),
24            contents: self.emit_css(css),
25        }]
26    }
27}