Implement bounded Notation LLSD codec

This commit is contained in:
2026-08-09 00:51:05 +00:00
parent 7a4f1f2fb1
commit 2308e55671
11 changed files with 1081 additions and 55 deletions

View File

@@ -242,9 +242,7 @@ impl OSDParser {
buffer: Vec<libremetaverse_types::compat::Utf16CodeUnit>,
offset: i32,
) -> Result<i32, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.BufferCharactersEqual(System.IO.StringReader,System.Char[],System.Int32)",
)
crate::notation::buffer_characters_equal(reader, buffer, offset)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.ConsumeBytes(System.IO.Stream,System.Int32)`.
pub fn consume_bytes(
@@ -303,17 +301,13 @@ impl OSDParser {
pub fn deserialize_llsd_notation_with_string_reader(
reader: libremetaverse_types::compat::StringReader,
) -> Result<libremetaverse_structured_data::OSD, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.DeserializeLLSDNotation(System.IO.StringReader)",
)
crate::notation::deserialize_reader(reader)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.DeserializeLLSDNotation(System.String)`.
pub fn deserialize_llsd_notation_with_string(
notation_data: String,
) -> Result<libremetaverse_structured_data::OSD, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.DeserializeLLSDNotation(System.String)",
)
crate::notation::deserialize_string(notation_data)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.DeserializeLLSDProtobuf(System.Byte[])`.
pub fn deserialize_llsd_protobuf_with_bytes(
@@ -368,9 +362,7 @@ impl OSDParser {
s: String,
c: libremetaverse_types::compat::Utf16CodeUnit,
) -> Result<String, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.EscapeCharacter(System.String,System.Char)",
)
crate::notation::escape_character(s, c)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.FindByte(System.IO.Stream,System.Byte)`.
pub fn find_byte(
@@ -390,18 +382,14 @@ impl OSDParser {
pub fn get_length_in_brackets(
reader: libremetaverse_types::compat::StringReader,
) -> Result<i32, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.GetLengthInBrackets(System.IO.StringReader)",
)
crate::notation::get_length_in_brackets(reader)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.GetStringDelimitedBy(System.IO.StringReader,System.Char)`.
pub fn get_string_delimited_by(
reader: libremetaverse_types::compat::StringReader,
delimiter: libremetaverse_types::compat::Utf16CodeUnit,
) -> Result<String, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.GetStringDelimitedBy(System.IO.StringReader,System.Char)",
)
crate::notation::get_string_delimited_by(reader, delimiter)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.HostToNetworkIntBytes(System.Int32)`.
pub fn host_to_network_int_bytes(int_host_end: i32) -> Result<Vec<u8>, crate::Error> {
@@ -419,17 +407,13 @@ impl OSDParser {
pub fn peek_and_skip_whitespace(
reader: libremetaverse_types::compat::StringReader,
) -> Result<i32, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.PeekAndSkipWhitespace(System.IO.StringReader)",
)
crate::notation::peek_and_skip_whitespace(reader)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.ReadAndSkipWhitespace(System.IO.StringReader)`.
pub fn read_and_skip_whitespace(
reader: libremetaverse_types::compat::StringReader,
) -> Result<i32, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.ReadAndSkipWhitespace(System.IO.StringReader)",
)
crate::notation::read_and_skip_whitespace(reader)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.SerializeJsonString(LibreMetaverse.StructuredData.OSD,System.Boolean)`.
pub fn serialize_json_string(
@@ -478,33 +462,25 @@ impl OSDParser {
pub fn serialize_llsd_notation(
osd: libremetaverse_structured_data::OSD,
) -> Result<String, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotation(LibreMetaverse.StructuredData.OSD)",
)
crate::notation::serialize(osd)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationFormatted(LibreMetaverse.StructuredData.OSD)`.
pub fn serialize_llsd_notation_formatted(
osd: libremetaverse_structured_data::OSD,
) -> Result<String, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationFormatted(LibreMetaverse.StructuredData.OSD)",
)
crate::notation::serialize_formatted(osd)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationStream(LibreMetaverse.StructuredData.OSD)`.
pub fn serialize_llsd_notation_stream(
osd: libremetaverse_structured_data::OSD,
) -> Result<libremetaverse_types::compat::StringWriter, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationStream(LibreMetaverse.StructuredData.OSD)",
)
crate::notation::serialize_stream(osd)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationStreamFormatted(LibreMetaverse.StructuredData.OSD)`.
pub fn serialize_llsd_notation_stream_formatted(
osd: libremetaverse_structured_data::OSD,
) -> Result<libremetaverse_types::compat::StringWriter, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDNotationStreamFormatted(LibreMetaverse.StructuredData.OSD)",
)
crate::notation::serialize_stream_formatted(osd)
}
/// C# member: `M:LibreMetaverse.StructuredData.OSDParser.SerializeLLSDProtobuf(LibreMetaverse.StructuredData.OSD,System.Boolean)`.
pub fn serialize_llsd_protobuf(
@@ -551,9 +527,7 @@ impl OSDParser {
s: String,
c: libremetaverse_types::compat::Utf16CodeUnit,
) -> Result<String, crate::Error> {
libremetaverse_types::not_implemented(
"M:LibreMetaverse.StructuredData.OSDParser.UnescapeCharacter(System.String,System.Char)",
)
crate::notation::unescape_character(s, c)
}
}