[stdlib] Add PEM Encoding/Decoding Module (#2858)

* [stdlib] Add PEM Encoding/Decoding Module
* release notes
* Removed some unnecessary macro usages. Fixed memory handling with headers.
* Make end of line a parameter. Internal encode method -> function. Use more tmem. Remove t-functions.
* Update API

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
This commit is contained in:
Zack Puhl
2026-02-05 18:01:07 -05:00
committed by GitHub
parent 1933d47ba1
commit 4521a25284
4 changed files with 648 additions and 1 deletions

View File

@@ -160,7 +160,12 @@ macro bool char_in_set(char c, String set)
}
<*
@return "a String which is safe to convert to a ZString"
Join together an array of strings via a "joiner" sequence, which is inserted between each element.
@param [&inout] allocator : "The allocator to use."
@param [in] s : "An array of strings to join in sequence."
@param [in] joiner : "The string used to join each element of `s`."
@return "A single string containing the result, allocated via `allocator`, safe to convert to a ZString."
*>
fn String join(Allocator allocator, String[] s, String joiner)
{
@@ -189,6 +194,9 @@ fn String join(Allocator allocator, String[] s, String joiner)
return (String)data[:offset];
}
<* Alias for `string::join` using the temp allocator. *>
macro String tjoin(String[] s, String joiner) => join(tmem, s, joiner);
<*
Replace all instances of one substring with a different string.