{"id":16607808,"url":"https://github.com/adriweb/tivars_lib_cpp","last_synced_at":"2025-08-19T13:11:11.201Z","repository":{"id":50947356,"uuid":"43937648","full_name":"adriweb/tivars_lib_cpp","owner":"adriweb","description":"A C++ library to interact with TI-z80 (82/83/84 series) calculators files (programs, lists, matrices, etc.)","archived":false,"fork":false,"pushed_at":"2024-08-06T19:13:57.000Z","size":2828,"stargazers_count":27,"open_issues_count":4,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-14T15:52:17.559Z","etag":null,"topics":["file","format","generator","parser","program","ti-82","ti-83","ti-84","token","tokenizer","variables"],"latest_commit_sha":null,"homepage":"http://ti-pla.net/t17385","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/adriweb.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-09T06:42:36.000Z","updated_at":"2025-02-24T19:13:04.000Z","dependencies_parsed_at":"2024-04-07T21:28:54.311Z","dependency_job_id":"04ac8ccc-a381-4afe-88db-82224bd2f8d0","html_url":"https://github.com/adriweb/tivars_lib_cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriweb%2Ftivars_lib_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriweb%2Ftivars_lib_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriweb%2Ftivars_lib_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adriweb%2Ftivars_lib_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adriweb","download_url":"https://codeload.github.com/adriweb/tivars_lib_cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830949,"owners_count":20354854,"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":["file","format","generator","parser","program","ti-82","ti-83","ti-84","token","tokenizer","variables"],"created_at":"2024-10-12T01:23:53.647Z","updated_at":"2025-03-16T21:30:55.103Z","avatar_url":"https://github.com/adriweb.png","language":"C++","readme":"# tivars_lib_cpp [![Build](https://github.com/adriweb/tivars_lib_cpp/actions/workflows/build.yml/badge.svg)](https://github.com/adriweb/tivars_lib_cpp/actions/workflows/build.yml)\nA C++ \"library\" to interact with TI-Z80/eZ80 (82/83/84 series) calculators files (programs, lists, matrices...).  \nJavaScript bindings (for use with emscripten) are provided for convenience.\n\n### How to use\n\n#### In C++\n\nRight now, the best documentation is [the tests file](tests.cpp) itself, which uses the main API methods.  \nBasically, though, there are loading/saving/conversion (data-\u003estring, string-\u003edata) methods you just have to call.\n\n**Example 1**: Here's how to read the source of TI-Basic program from an .8xp file and print it:\n```cpp\nauto myPrgm = TIVarFile::loadFromFile(\"the/path/to/myProgram.8xp\");\nauto basicSource = myPrgm.getReadableContent(); // You can pass options like { {\"reindent\", true} }...\nstd::cout \u003c\u003c basicSource \u003c\u003c std::endl;\n```\n**Example 2**: Here's how to create a TI-Basic program (output: .8xp file) from a string:\n```cpp\nauto newPrgm = TIVarFile::createNew(\"Program\");                       // Create an empty \"container\" first\nnewPrgm.setVarName(\"TEST\");                                           // (also an optional parameter above)\nnewPrgm.setContentFromString(\"ClrHome:Disp \\\"Hello World!\\\"\");        // Set the var's content from a string\nnewPrgm.saveVarToFile(\"path/to/output/directory/\", \"myNewPrgrm\");     // The extension is added automatically\n```\n\nSeveral optional parameters for the functions are available. For instance, French is a supported input/output language for the program vartype, which is choosable with a boolean in an options array to pass.\n\n_Note: The code throws exceptions for you to catch in case of trouble._\n\n#### In JavaScript (via Emscripten)\n\nBindings are done for the necessary classes, so it should be pretty obvious.  \nIntegration example:\n```html\n\u003cscript type=\"module\"\u003e\n    import TIVarsLib from './TIVarsLib.js';\n    const lib = await TIVarsLib();\n    const prgm = lib.TIVarFile.createNew(\"Program\", \"TEST\");\n    prgm.setContentFromString(\"ClrHome:Disp \\\"Hello World!\\\"\");\n    const filePath = prgm.saveVarToFile(\"\", \"MyTestProgram\");\n    const file = lib.FS.readFile(filePath, {encoding: 'binary'});\n    ...\n\u003c/script\u003e\n```\n\nYou can find code that use this project as a JS lib here: https://github.com/TI-Planet/zText (look at `generator.js`)\n\n### Vartype handlers implementation: current status\n\n| Vartype                   | data-\u003estring | string-\u003edata |\n|---------------------------|:------------:|:------------:|\n| Real                      |    **✓**     |    **✓**     |\n| Real List                 |    **✓**     |    **✓**     |\n| Matrix                    |    **✓**     |    **✓**     |\n| Equation                  |    **✓**     |    **✓**     |\n| String                    |    **✓**     |    **✓**     |\n| Program                   |    **✓**     |    **✓**     |\n| Protected Program         |    **✓**     |    **✓**     |\n| Graph DataBase (GDB)      | **✓** (JSON) | **✓** (JSON) |\n| Complex                   |    **✓**     |    **✓**     |\n| Complex List              |    **✓**     |    **✓**     |\n| Application Variable      |    **✓**     |    **✓**     |\n| Python AppVar             |    **✓**     |    **✓**     |\n| Exact Complex Fraction    |    **✓**     |              |\n| Exact Real Radical        |    **✓**     |              |\n| Exact Complex Radical     |    **✓**     |              |\n| Exact Complex Pi          |    **✓**     |              |\n| Exact Complex Pi Fraction |    **✓**     |              |\n| Exact Real Pi             |    **✓**     |              |\n| Exact Real Pi Fraction    |    **✓**     |              |\n\nNote that some of the special varnames restrictions (for strings, matrices, list...) aren't implemented yet.\n\nTo this date, there are no plans to support other types (except maybe some fancy things with the image/picture vartypes...).  \nPull Requests are welcome, though :)\n","funding_links":[],"categories":["All Resources"],"sub_categories":["Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriweb%2Ftivars_lib_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadriweb%2Ftivars_lib_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadriweb%2Ftivars_lib_cpp/lists"}