Coverage for src / rtflite / encoding / engine.py: 100%
7 statements
« prev ^ index » next coverage.py v7.12.0, created at 2025-12-08 04:50 +0000
« prev ^ index » next coverage.py v7.12.0, created at 2025-12-08 04:50 +0000
1"""RTF encoding engine for orchestrating document generation."""
3from typing import TYPE_CHECKING
5from .unified_encoder import UnifiedRTFEncoder
7if TYPE_CHECKING:
8 from ..encode import RTFDocument
11class RTFEncodingEngine:
12 """Main engine for RTF document encoding.
14 This class orchestrates the encoding process using the UnifiedRTFEncoder
15 which implements the strategy pattern for pagination and rendering.
16 """
18 def __init__(self):
19 self._encoder = UnifiedRTFEncoder()
21 def encode_document(self, document: "RTFDocument") -> str:
22 """Encode an RTF document using the unified encoder.
24 Args:
25 document: The RTF document to encode
27 Returns:
28 Complete RTF string
29 """
30 return self._encoder.encode(document)