{"id":22914499,"url":"https://github.com/cdacamar/fredbuf","last_synced_at":"2025-08-03T19:10:59.330Z","repository":{"id":174495250,"uuid":"649553081","full_name":"cdacamar/fredbuf","owner":"cdacamar","description":"The textbuf which drives fred","archived":false,"fork":false,"pushed_at":"2024-01-12T07:41:24.000Z","size":148,"stargazers_count":134,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T13:52:10.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdacamar.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-05T06:11:40.000Z","updated_at":"2025-04-25T03:10:39.000Z","dependencies_parsed_at":"2023-12-13T09:11:41.046Z","dependency_job_id":"090110ea-06fe-4b0b-a296-62b8c62c18d7","html_url":"https://github.com/cdacamar/fredbuf","commit_stats":null,"previous_names":["cdacamar/fredbuf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdacamar/fredbuf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdacamar%2Ffredbuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdacamar%2Ffredbuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdacamar%2Ffredbuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdacamar%2Ffredbuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdacamar","download_url":"https://codeload.github.com/cdacamar/fredbuf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdacamar%2Ffredbuf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268598224,"owners_count":24276145,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-14T05:15:28.790Z","updated_at":"2025-08-03T19:10:59.289Z","avatar_url":"https://github.com/cdacamar.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project\r\n\r\nThis is the text buffer implementation described in [Text Editor Data Structures](https://cdacamar.github.io/data%20structures/algorithms/benchmarking/text%20editors/c++/editor-data-structures/?fbclid=IwAR1KPqHQU-torrzSq7LKWgK3uUZsTaoEpiAQeDT8XlvlOD3MCSt3sEl2YXc).\r\n\r\n## API\r\n\r\nBuilding:\r\n\r\n```c++\r\nusing namespace PieceTree;\r\nTreeBuilder builder;\r\nbuilder.accept(\"ABC\");\r\nbuilder.accept(\"DEF\");\r\nauto tree = builder.create();\r\n// Resulting total buffer: \"ABCDEF\"\r\n```\r\n\r\nInsertion:\r\n\r\n```c++\r\ntree.insert(CharOffset{ 0 }, \"foo\");\r\n// Resulting total buffer: \"fooABCDEF\"\r\n```\r\n\r\nDeletion:\r\n\r\n```c++\r\ntree.remove(CharOffset{ 6 }, Length{ 3 });\r\n// Resulting total buffer: \"fooABC\"\r\n```\r\n\r\nLine retrieval:\r\n\r\n```c++\r\nstd::string buf;\r\ntree.get_line_content(\u0026buf, Line{ 1 });\r\n// 'buf' contains \"fooABC\"\r\n```\r\n\r\nIteration:\r\n\r\n```c++\r\nfor (char c : buf)\r\n{\r\n    printf(\"%c\", c);\r\n}\r\n```\r\n\r\n## Contributing\r\n\r\nFeel free to open up a PR or issue but there's no guarantee it will get merged.\r\n\r\n## Building\r\n\r\nIf you're on Windows, open a developer command prompt and invoke `b.bat`.  Do the same for essentially any other compiler except change the flags to be specific to your compiler.  It's all standard C++ all the way down.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdacamar%2Ffredbuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdacamar%2Ffredbuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdacamar%2Ffredbuf/lists"}