blob: 02b480b4f7158d891e84aaaee10b744e78e68d9b [file] [log] [blame] [edit]
# WARNING: This file is machine generated by fidlgen.
from __future__ import annotations
from dataclasses import dataclass
from fidl_codec import add_ir_path, encode_fidl_object
import sys
import typing
import enum
import fidl
from fidl._ir import get_fidl_ir_map
_ir_path = get_fidl_ir_map()["test.escaping"]
add_ir_path(_ir_path)
@dataclass
class DocCommentWithQuotes:
"""
\"pleaseescapethisdocommentproperly\"
"""
__fidl_kind__ = "struct"
__fidl_type__ = "DocCommentWithQuotes"
__fidl_raw_type__ = "test.escaping/DocCommentWithQuotes"
# TODO(https://fxbug.dev/394421154): We should probably remove this method when we
# start making breaking changes.
def __getitem__(self, item: str): # type: ignore
if not isinstance(item, str):
raise TypeError("Subscripted item must be a string")
return getattr(self, item)
# TODO(https://fxbug.dev/394421154): We should probably return a more readable type.
def encode(self) -> tuple[bytes, list[tuple[int, int, int, int, int]]]:
return encode_fidl_object(
self, "test.escaping", "test.escaping/DocCommentWithQuotes"
)
# TODO(https://fxbug.dev/394421154): Assigning None (incorrectly) to each type is a consequence
# of needing to support creation of a "default object" before decoding.
@classmethod
def make_default(cls) -> typing.Self:
return cls(**{})
# Generated constants
BASIC: str = """\'\"\\
"""
DOLLAR: str = """$"""
DOLLAR_BRACE: str = """${"""
MAX: str = """􏿿"""
NULL: str = """\x00"""
SMILE_LEADING_ZERO: str = """😀"""
SMILE_LITERAL: str = """😀"""
SMILE_LOWER: str = """😀"""
SMILE_UPPER: str = """😀"""