{"id":23168845,"url":"https://github.com/chris-huxtable/cbhstringsplitter","last_synced_at":"2025-04-04T22:45:00.809Z","repository":{"id":56904210,"uuid":"219220888","full_name":"chris-huxtable/CBHStringSplitter","owner":"chris-huxtable","description":"A convenient utility for splitting stings with a minimal memory footprint.","archived":false,"fork":false,"pushed_at":"2019-11-22T01:29:00.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T07:35:40.114Z","etag":null,"topics":["objective-c","objective-c-library"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-huxtable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-02T22:17:29.000Z","updated_at":"2019-11-23T05:33:47.000Z","dependencies_parsed_at":"2022-08-21T02:50:21.426Z","dependency_job_id":null,"html_url":"https://github.com/chris-huxtable/CBHStringSplitter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHStringSplitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHStringSplitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHStringSplitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHStringSplitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-huxtable","download_url":"https://codeload.github.com/chris-huxtable/CBHStringSplitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261581,"owners_count":20910107,"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":["objective-c","objective-c-library"],"created_at":"2024-12-18T03:13:52.332Z","updated_at":"2025-04-04T22:45:00.785Z","avatar_url":"https://github.com/chris-huxtable.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CBHStringSplitter\n\n[![release](https://img.shields.io/github/release/chris-huxtable/CBHStringSplitter.svg)](https://github.com/chris-huxtable/CBHStringSplitter/releases)\n[![pod](https://img.shields.io/cocoapods/v/CBHStringSplitter.svg)](https://cocoapods.org/pods/CBHStringSplitter)\n[![licence](https://img.shields.io/badge/licence-ISC-lightgrey.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHStringSplitter/blob/master/LICENSE)\n[![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHStringSplitter)\n\n`CBHStringSplitter` is an `NSEnumerator` subclass which splits strings using an `NSInputStream` to process input with minimal memory use. \n\nWhile `CBHStringSplitter` is slightly slower than the equivalent `componentsSeparatedByCharactersInSet` it does not load the entire contents of a file into memory. This makes it more appropriate for some use cases.\n\n\n## Examples\n\n### Process each line in a file using a for in loop:\n\n```objective-c\nNSString *path = @\"/path/to/file\";\nCBHStringSplitter *splitter = [CBHStringSplitter splitterWithFileAtPath:path andSeparators:[NSCharacterSet newlineCharacterSet]];\n\nfor (NSString *line in splitter)\n{\n\t// Do something with the line...\n}\n```\n\n\n### Process each line in a file using a while loop:\n\n```objective-c\nNSString *path = @\"/path/to/file\";\nCBHStringSplitter *splitter = [CBHStringSplitter splitterWithFileAtPath:path andSeparators:[NSCharacterSet newlineCharacterSet]];\n\nNSString *line;\nwhile ( (line = [splitter nextObject]) )\n{\n\t// Do something with the line...\n}\n```\n\n\n## Notes:\n\n- Unlike `componentsSeparatedByCharactersInSet` if the input is suffixed with a separator character an empty string will not be given as the last entry. It will just be ignored.\n\n\n## TODO:\n - Performance Improvements\n - Simplify buffering\n - Block based enumeration\n\nPull requests are welcome.\n\n\n## Licence\nCBHStringSplitter is available under the [ISC license](https://github.com/chris-huxtable/CBHStringSplitter/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhstringsplitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-huxtable%2Fcbhstringsplitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhstringsplitter/lists"}