{"id":18521796,"url":"https://github.com/simphotonics/quote_buffer","last_synced_at":"2025-05-14T18:09:19.567Z","repository":{"id":54131948,"uuid":"234786176","full_name":"simphotonics/quote_buffer","owner":"simphotonics","description":"Extension methods for transforming single objects and iterables into quoted strings and writing them to a string buffer.","archived":false,"fork":false,"pushed_at":"2024-04-04T17:33:26.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T05:25:24.164Z","etag":null,"topics":["dart","generation","generator","quoted-strings","quotes","source-code","string-buffer"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/quote_buffer","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simphotonics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-01-18T19:30:50.000Z","updated_at":"2024-04-04T15:38:47.000Z","dependencies_parsed_at":"2024-11-06T17:35:39.232Z","dependency_job_id":"577e7030-1cbd-46a9-b600-fdcb47fea21c","html_url":"https://github.com/simphotonics/quote_buffer","commit_stats":{"total_commits":131,"total_committers":2,"mean_commits":65.5,"dds":0.04580152671755722,"last_synced_commit":"2a8f108175e41e90cd7ca663c7e6ee91eb04c4a9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fquote_buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fquote_buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fquote_buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simphotonics%2Fquote_buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simphotonics","download_url":"https://codeload.github.com/simphotonics/quote_buffer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198510,"owners_count":22030966,"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":["dart","generation","generator","quoted-strings","quotes","source-code","string-buffer"],"created_at":"2024-11-06T17:27:39.678Z","updated_at":"2025-05-14T18:09:14.552Z","avatar_url":"https://github.com/simphotonics.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quote Buffer\n[![Dart](https://github.com/simphotonics/quote_buffer/actions/workflows/dart.yml/badge.svg)](https://github.com/simphotonics/quote_buffer/actions/workflows/dart.yml)\n\n## Introduction\n\nIn the context of source code generation it is required to enclose emitted strings with\n(escaped) quotation marks. In the following, such strings are called *quoted strings*.\nManually delimiting strings with quotation marks is error-prone\nand repetitive especially when dealing with a collection of string-items.\n\nThe package [`quote_buffer`][quote_buffer] provides [`Quote`][Quote]\nan extension on Dart's [`StringBuffer`][StringBuffer] that adds  methods for\ntransforming single objects and lists of objects into *quoted strings*.\n\n## Usage\n\nTo use this library include [`quote_buffer`][quote_buffer] as dependency in your `pubspec.yaml` file.\nThe section below lists the methods provided\nand shows the console output obtained by printing the buffer content.\n\n1. **writeQ**(Object obj, {QuotationMark delimiter})\n\n    Writes *delimiter*, *obj*, *delimiter* to the buffer.\n    ```Dart\n    import 'package:quote_buffer/quote_buffer.dart';\n\n    final b = StringBuffer();\n    b.writeQ(29);\n    expect(b.toString(),'\\'29\\'');\n    print(b.toString()); // Console output below\n    ```\n    ```Console\n    '29'\n    ```\n\n2. **writelnQ**(Object obj, {QuotationMark delimiter})\n\n    Writes *delimiter*, *obj*, *delimiter*, *newline symbol* to the buffer.\n    ```Dart\n    import 'package:quote_buffer/quote_buffer.dart';\n\n    final b = StringBuffer();\n    b.writelnQ('name', delimiter: QuotationMark.double);\n    expect(b.toString(), '\\\"name\\\"\\n');\n    print(b.toString()); // Console output below\n    print('--- ---');\n    ```\n    ```Console\n    \"name\"\n\n    --- ---\n    ```\n3. **writeAllQ**(Iterable objects, {String separator, QuotationMark delimiter})\n\n    Writes *delimiter*, *first object*, *delimiter*, etc. to the buffer.\n    ```Dart\n    import 'package:quote_buffer/quote_buffer.dart';\n\n    final b = StringBuffer();\n    b.writeAllQ(\n      ['one','two','three'],\n       separator: ', ',\n    );\n    expect(b.toString(), '\\'one\\', \\'two\\', \\'three\\'' );\n    print(b.toString()); // Console output below\n    ```\n    ```Console\n    'one', 'two', 'three'\n    ```\n\n4. **writelnAllQ**(Iterable objects, {String separator1, String separator2, QuoationMark delimiter})\n\n    Writes *objects* in sequence: *delimiter*, *objects[0]*, *separator1*, *delimiter*, *separator2*, *newline symbol*, etc.\n    ```Dart\n    import 'package:quote_buffer/quote_buffer.dart';\n\n    final b = StringBuffer();\n    b.writelnAllQ(\n      ['one','two','three'],\n      separator1: ' #',\n      separator2: ',',\n      delimiter: QuotationMark.double,\n    );\n    expect(b.toString(), '\\\"one #\\\",\\n\\\"two #\\\",\\n\\\"three\\#');\n    print(b.toString()); // Console output below\n    print('--- ---');\n    ```\n    ```Console\n     \"one #\",\n     \"two #\",\n     \"three\"\n\n     --- ---\n    ```\n\n## Examples\n\nThe example located in the folder [example] shows how to use the extension\n[`Quote`][Quote] to simplify the generation of string literals whose content is enclosed by escaped quotation marks.\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker].\n\n[issue tracker]: https://github.com/simphotonics/quote_buffer/issues\n\n[example]: https://github.com/simphotonics/quote_buffer/tree/main/example\n\n[quote_buffer]: https://pub.dev/packages/quote_buffer\n\n[Quote]: https://pub.dev/documentation/quote_buffer/latest/quote_buffer/Quote.html\n\n[StringBuffer]: https://api.dart.dev/stable/dart-core/StringBuffer-class.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimphotonics%2Fquote_buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimphotonics%2Fquote_buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimphotonics%2Fquote_buffer/lists"}