mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
[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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user