{"id":16985809,"url":"https://github.com/as400jplpc/zig_string","last_synced_at":"2025-03-22T01:42:03.271Z","repository":{"id":174038277,"uuid":"548008477","full_name":"AS400JPLPC/zig_string","owner":"AS400JPLPC","description":"UTF-8 String Library","archived":false,"fork":false,"pushed_at":"2025-03-10T21:48:52.000Z","size":1971,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T22:30:41.026Z","etag":null,"topics":["string","string-manipulation","zig","zoned"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AS400JPLPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-08T18:48:25.000Z","updated_at":"2025-03-10T21:48:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c4e9fa5-e290-4860-a6b4-67634456ad99","html_url":"https://github.com/AS400JPLPC/zig_string","commit_stats":null,"previous_names":["as400jplpc/zig_string"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AS400JPLPC%2Fzig_string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AS400JPLPC%2Fzig_string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AS400JPLPC%2Fzig_string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AS400JPLPC%2Fzig_string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AS400JPLPC","download_url":"https://codeload.github.com/AS400JPLPC/zig_string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894309,"owners_count":20527669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["string","string-manipulation","zig","zoned"],"created_at":"2024-10-14T02:44:13.498Z","updated_at":"2025-03-22T01:42:03.265Z","avatar_url":"https://github.com/AS400JPLPC.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zig_string\nUTF-8 String Library\n\n# FORK\n[JakubSzark/zig-string]((https://github.com/JakubSzark/zig-string))\n\n\n**a big thank-you Jakub Szarkowicz  real work**\n\nThis library is a UTF-8 compatible **string** library for the **Zig** programming language. \nI made this for the sole purpose to further my experience and understanding of zig.\nAlso it may be useful for some people who need it (including myself), with future projects. Project is also open for people to add to and improve. Please check the **issues** to view requested features.\n\u003cbr/\u003e\n\u003cbr/\u003e\nIf you use an uninitialized or already uninitialized field, this will trigger an @panic error.  --\u003e CRTL\n\u003cbr/\u003e\n\n\u003cbr/\u003e\nThe special feature: the addition of normalization to match the use in databases as well as when using screens or for lists.\n\u003cbr/\u003e\n\u003cbr/\u003e\n# Basic Usage\n```zig\nconst zfld = @import(\"zfield\");\n// ...\n\n// Create your String\n// nbc = 0 usual string \n// nbc \u003e 0 usual varchar(..) --\u003e zoned \nvar myString = zfld.ZFIELD.init(30);\ndefer myString.deinit();\n\n// Use functions provided\ntry myString.concat(\"🔥 Hello!\");\n_ = myString.pop();\ntry myString.concat(\", World 🔥\");\n\nstd.debug.print(\"{s}\",.{myString.string()});\n```\n\n*Look at the test.zig and testmem.zig files*\n\n\n\n# Things needed\n- Optimizations\n- Better documentation\n- More Testing\n\n# How to Contribute\n1. Fork\n2. debug\n3. Make a Test\n\n(I'm no expert when it comes to complexity)\n\n\n\u003c/br\u003e\n\n```\nvar arenaZfld = std.heap.ArenaAllocator.init(std.heap.page_allocator);\nvar allocZfld = arenaZfld.allocator();\npub fn deinitZfld() void {\n    arenaZfld.deinit();\n    arenaZfld = std.heap.ArenaAllocator.init(std.heap.page_allocator);\n    allocZfld = arenaZfld.allocator();\n}\n```\n\n\u003c/br\u003e\n\n\n|Function      | Description                              | Pub |Debug|Option|bool|Panic|Crtl |\n|--------------|------------------------------------------|-----|-----|------|----|-----|-----|\n|init          | Creates String with Allocator \u0026 nbr char |  x  |     |      |    |     |     |\n|deinit        | De-allocates the String                  |  x  |     |      |    |     |     |\n|              |                                          |     |     |      |    |     |     |\n|allocate      | Sets the internal buffer size            |     |     |      |    |     |  x  |\n|capacity      | Returns the capacity of the String       |  x  |     |      |    |     |  x  |\n|getnbc        | Return the numbers init char             |  x  |     |      |    |     |     |  \n|Count         | Returns count of characters stored       |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|clear         | Clears the contents of the String        |  x  |     |      |    |     |  x  |\n|cmpeql        | Compares to (zlfd,zfld)                  |  x  |     |      | x  |     |  x  |\n|cmpeqlStr     | Compares to string literal               |  x  |     |      | x  |     |  x  |\n|cmpxx         | Compares to (zlfd,zfld)  l EQ LT GT      |  x  |     |      |    |     |  x  |\n|cmpxxStr      | Compares to string literal EQ LT GT      |  x  |     |      | x  |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|setZfld       | Erase append string literal of normalize |  x  |     |      |    |     |  x  |\n|Normalize     | Truncate for SQL Screen ex:varchar(10)   |     |     |      |    |     |     |\n|getstr        | Returns the String as a slice            |     |     |      |    |     |     |\n|string        | Returns the Field string                 |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|clone         | Duplicate field                          |  x  |     |      |    |     |  x  |\n|pop           | Removes the last character               |  x  |  x  |      |    |     |  x  |\n|copy          | Copies this string to a new one field    |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|substr        | Sub-string a range of characters         |  x  |  x  |      |    |  x  |  x  |\n|remove        | Removes a range of characters            |  x  |  x  |      |    |  x  |  x  |\n|              |                                          |     |     |      |    |     |     |\n|isEmpty       | Checks if length is zero                 |  x  |     |      |    |     |     |\n|find          | Finds first string literal appearance    |  x  |     |  x   | x  |     |  x  |\n|rfind         | Finds last  string literal appearance    |  x  |     |  x   |    |     |  x  |\n|findpos       | Finds position occurrence of literal     |  x  |     |  x   |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|concat        | Appends a characters of the field        |  x  |     |      |    |     |  x  |\n|concatStr     | Appends a characters of the literal      |  x  |     |      |    |     |  x  |\n|truncat       | Reallocates the  buffer to size          |  x  |  x  |      |    |  x  |  x  |\n|              |                                          |     |     |      |    |     |     |\n|replace       | Replaces all occurrences of a zstring    |  x  |     |      | x  |     |  x  |\n|reverse       | Reverses the characters in this zstring  |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|lowercase     | Converts to lowercase                    |  x  |     |      |    |     |  x  |\n|uppercase     | Converts to uppercase                    |  x  |     |      |    |     |  x  |\n|capitalized   | Converts to uppercase first word         |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|trim          | trim(zstring,whitelist)                  |  x  |     |      |    |     |  x  |\n|trimLeft      | trimLef(zstring,whitelist)               |  x  |     |      |    |     |  x  |\n|trim          | trimRight(zstring,whitelist)             |  x  |     |      |    |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|check         | Checks if the needle zstring             |  x  |     |      | x  |     |  x  |\n|checkStr      | Checks if the needle Literal             |  x  |     |      | x  |     |  x  |\n|              |                                          |     |     |      |    |     |     |\n|charAt        | Returns character at index               |  x  |  x  |      |    |  x  |  x  |\n|              |                                          |     |     |      |    |     |     |\n|zfldIterator  | Struct Iterator                          |  x  |     |      |    |     |     |\n|next          | next iterator Char(UTF8)                 |  x  |     |      |    |     |     |\n|iterator      | Returns a StringIterator over the String |  x  |     |      |    |     |     |\n|isUTF8Byte    | Checks if byte is part of UTF-8 character|     |     |      |    |     |     |\n|getUTF8Size   | Returns the UTF-8 character's size       |     |     |      |    |     |     |\n|getIndex      | Returns the real index of a unicode      |     |     |  x   |    |     |     |\n\n\n\u003cbr/\u003e\n\u003cbr/\u003e\nglobal allocator\n\n```\n    var arenaZfld = std.heap.ArenaAllocator.init(std.heap.page_allocator);\n    var allocZfld = arenaZfld.allocator();\n\n\tpub fn deinitZfld() void {\n\t    arenaZfld.deinit();\n\t    arenaZfld = std.heap.ArenaAllocator.init(std.heap.page_allocator);\n\t    allocZfld = arenaZfld.allocator();\n\t}\n```\n\nif use zlfd.deinitZfld();\n\n\n**All tests comply with AS400 processing requirements**\n\n\nProgress:\u003cbr/\u003e\n\n- 2025-01-30 18:53 -\u003e  Control, test and lock, security, compliance, a few hours or days... test the principle.\u003cbr/\u003e\nI'm not satisfied, I'd like to have a \"job-logs\"' a bit like the system log,\u003cbr/\u003e\nI'm thinking of a follow-up done with SQLite with a mini-server ... for optimum traceability.\u003cbr/\u003e\n- 2025-03-07 04:55 -\u003e zig 0.14.0\u003cbr/\u003e  \n- 2025-03-10 17:25 -\u003e Resuming diagnostics with the better-understood 0.14.0 @src deciphering @panic\u003cbr/\u003e\n\n\u003c/BR\u003e\n→ 2025-03-12 06:40   unicode.Decode deprecated change Utf8View \u003cBR/\u003e\n\u003c/BR\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas400jplpc%2Fzig_string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fas400jplpc%2Fzig_string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas400jplpc%2Fzig_string/lists"}