{"id":17975779,"url":"https://github.com/aiekick/ctools","last_synced_at":"2025-03-25T15:30:42.969Z","repository":{"id":63387205,"uuid":"240878205","full_name":"aiekick/cTools","owner":"aiekick","description":"some helpers im using since 2009. contain usefull things like vec2, vec3, vec4, variant, actionTime and more","archived":false,"fork":false,"pushed_at":"2024-09-12T22:24:25.000Z","size":563,"stargazers_count":18,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T13:04:45.287Z","etag":null,"topics":["aabbcc","actiontime","conversion","cpp","cross-platform","ctools","free-library","helper","linux","logger","macos","math","osx","rect","toolkit","variant","vec4","windows"],"latest_commit_sha":null,"homepage":"","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/aiekick.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":"2020-02-16T11:18:50.000Z","updated_at":"2024-09-12T22:24:28.000Z","dependencies_parsed_at":"2023-02-12T13:17:29.226Z","dependency_job_id":"485a44ab-f4d9-4a4a-a770-309abc91b292","html_url":"https://github.com/aiekick/cTools","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/aiekick%2FcTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiekick%2FcTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiekick%2FcTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiekick%2FcTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aiekick","download_url":"https://codeload.github.com/aiekick/cTools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245489754,"owners_count":20623789,"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":["aabbcc","actiontime","conversion","cpp","cross-platform","ctools","free-library","helper","linux","logger","macos","math","osx","rect","toolkit","variant","vec4","windows"],"created_at":"2024-10-29T17:21:18.595Z","updated_at":"2025-03-25T15:30:42.536Z","avatar_url":"https://github.com/aiekick.png","language":"C++","readme":"[![Win](https://github.com/aiekick/cTools/actions/workflows/Win.yml/badge.svg)](https://github.com/aiekick/cTools/actions/workflows/Win.yml)\n[![Linux](https://github.com/aiekick/cTools/actions/workflows/Linux.yml/badge.svg)](https://github.com/aiekick/cTools/actions/workflows/Linux.yml)\n[![Osx](https://github.com/aiekick/cTools/actions/workflows/Osx.yml/badge.svg)](https://github.com/aiekick/cTools/actions/workflows/Osx.yml)\n\n## cTools :\n\na two files helper im using from more than 10 years, in all my project.\nContain usefull templated things for c++ like vec2, vec3, vec4, variant, actionTime and more.\nneed a bit of refactoring btw :)\nuse the namespace ct\n\n- ct::cCyclicArray =\u003e circular list\n- ct::cActionTime =\u003e define when to do action according to time of last event\n- ct::cTexture =\u003e opengl texture simple container\n- ct::cColor =\u003e color class for conversion\n- ct::vec2\u003cT\u003e =\u003e vec2 class for quick operation / math x,y\n- ct::mat2\u003cT\u003e =\u003e mat2 class for matrix 2x2\n- ct::vec3\u003cT\u003e =\u003e vec3 class for quick operation / math x,y,z\n- ct::vec4\u003cT\u003e =\u003e vec4 class for quick operation / math x,y,z,w\n- ct::rect\u003cT\u003e =\u003e rect class for quick operation / math x,y,w,h\n- ct::AABB\u003cT\u003e =\u003e AABB 2D\n- ct::AABBCC\u003cT\u003e =\u003e AABBCC 3D\n- ct::variant\u003cT\u003e =\u003e variant class for quick conversion between many types and string\n\nand other string conversion / extraction etc..\n\n## Logger :\n\nLog method for check/write in auto in a log file\n\n- LogStr(n)\n- LogValue(s, n)\n- LogGlError()\n- LogGlErrorVar(var)\n- LogAssert(a,b)\n\n## FileHelper\n\nthis singleton is usefull for manipulate files / directory\nfully tested on win/LINUX/MACOS\n\n- convert from absolute to realtive to aantoher path\n- test aboslute or relative\n- is file exist\n- test if a file exist a list of path to search in\n- simplify a patth (like if you have toto/../toto/../toto =\u003e toto\n- get/set app path\n- get/set current directory\n- load/save file to/from string\n- parse file path name\n- destroy a file\n- open a fil in an external editor\n- open a url in a browser\n- select a file in os explorer\n- get drives (on win32)\n\ndependency : ctools, dirent/h, glfw if you want to use clipboard\n\n## ConfigAbstract\n\nConfigAbstract let you load/save a config file easily from class \nusing lib [tinyxml2](https://github.com/leethomason/tinyxml2)\n\nUsage :\n```cpp\nclass toto : public conf::ConfigAbstract\n{\npublic:\n\ttoto()\n\t{\n\t\tLoadConfigFile(\"config.xml\");\n\t}\n\n\t~toto()\n\t{\n\t\tSaveConfigFile(\"config.xml\");\n\t}\n\n\tstd::string getXml(const std::string\u0026 vOffset);\n\tvoid setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent);\n};\n\n\nstd::string toto::getXml(const std::string\u0026 vOffset)\n{\n\tstd::string str;\n\n\tstr += vOffset + \"\\t\u003ctata value=\\\"\" + \"true\" + \"\\\"/\u003e\\n\";\n\t\n\treturn str;\n}\n\nbool toto::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent)\n{\n\t// The value of this child identifies the name of this element\n\tstd::string strName = \"\";\n\tstd::string strValue = \"\";\n\tstd::string strParentName = \"\";\n\n\tstrName = vElem-\u003eValue();\n\tif (vElem-\u003eGetText())\n\t\tstrValue = vElem-\u003eGetText();\n\tif (vParent != 0)\n\t\tstrParentName = vParent-\u003eValue();\n\n\tauto att = vElem-\u003eFirstAttribute();\n\tif (att \u0026\u0026 std::string(att-\u003eName()) == \"value\")\n\t{\n\t\tstrValue = att-\u003eValue();\n\t\tif (strName == \"tata\")\n\t\t\tyouvar = strValue;\n\t}\n\t\n\treturn true; // parsing continue if childs or stop\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiekick%2Fctools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faiekick%2Fctools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiekick%2Fctools/lists"}