Skip to main content

azul_css/codegen/
cpp.rs

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