add lenpfx to valsep morphism
This commit is contained in:
parent
f8725c0624
commit
17a1e499d8
1 changed files with 28 additions and 0 deletions
|
@ -69,3 +69,31 @@ morph_seqseq_as_valsep_to_lenpfx (T: Type, Delim: T, EscKey: T)
|
|||
|
||||
return 0;
|
||||
```
|
||||
|
||||
morph_seqeq_as_lenpfx_to_valsep (T: Type, Delim: T, EscKey: T)
|
||||
< Seq~<LengthPrefix x86.UInt64>
|
||||
<Seq~<LengthPrefix x86.UInt64> T >
|
||||
~ <RefMut < Seq~<LengthPrefix x86.UInt64> T>>
|
||||
~ x86.Address
|
||||
~ x86.UInt64
|
||||
>
|
||||
--> < Seq <Seq T> >
|
||||
~ < ValueSep T Delim >
|
||||
~ < Seq~<LengthPrefix x86.UInt64> T >
|
||||
```
|
||||
length_prefix_uint8_array_clear( dst );
|
||||
|
||||
for( uint64_t i = 0; i < src->len; ++i ) {
|
||||
LengthPrefixUInt8Array * item = src->items[i];
|
||||
|
||||
for( uint64_t j = 0; j < item->len; ++j ) {
|
||||
length_prefix_uint8_array_push( items->items[j] );
|
||||
}
|
||||
|
||||
if( i+1 < src->len ) {
|
||||
length_prefix_uint8_array_push( Delim );
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue