{"id":16699420,"url":"https://github.com/ousttrue/pycpptool","last_synced_at":"2025-03-14T04:33:53.381Z","repository":{"id":136460778,"uuid":"180811194","full_name":"ousttrue/pycpptool","owner":"ousttrue","description":"tool for cpp source manipulation 🐲","archived":false,"fork":false,"pushed_at":"2019-09-13T04:04:51.000Z","size":230,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T23:29:22.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ousttrue.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":"2019-04-11T14:35:47.000Z","updated_at":"2019-09-13T04:04:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba635d94-110e-4360-b4b5-65f63eda593a","html_url":"https://github.com/ousttrue/pycpptool","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/ousttrue%2Fpycpptool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ousttrue%2Fpycpptool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ousttrue%2Fpycpptool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ousttrue%2Fpycpptool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ousttrue","download_url":"https://codeload.github.com/ousttrue/pycpptool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243526945,"owners_count":20305112,"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":[],"created_at":"2024-10-12T18:06:56.118Z","updated_at":"2025-03-14T04:33:53.371Z","avatar_url":"https://github.com/ousttrue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pycpptool\n\nA tool for cpp source manipulation 🐲\n\nParse cpp header and...\n\n* Generate dlang source for D3D11\n* Generate csharp source for D3D11\n\n## dependencies\n\n* install llvm(LLVM-8.0.0-win64.exe)\n* pip install clang\n\n## sample\n\n### for csharp\n\n```\npython pycpptool/run.py gen 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/shared/dxgi.h' '-i' 'dxgicommon.h' '-i' 'dxgiformat.h' '-i' 'dxgitype.h' '-o' '../windowskits/source' '-g' 'csharp'\n```\n\ngenerated\n\n```csharp\n[ComImport, Guid(\"aec22fb8-76f3-4639-9be0-28eb43a67a2e\")]\n[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] // \u003c- Required for com interface that directly inherited from IUnknown  \npublic interface IDXGIObject{\n}\n\n// Do no attach InterfaceType or cause corrupted vtable.\n[ComImport, Guid(\"7b7166ec-21c7-44ae-b21a-c9ae321ae369\")]\npublic interface IDXGIFactory: IDXGIObject {\n}\n```\n\nuse sample\n\n```csharp\n        static Guid uuidof\u003cT\u003e()\n        {\n            var attr = typeof(T).GetCustomAttributes(true).Select(x =\u003e x as GuidAttribute).First(x =\u003e x != null);\n            return new Guid(attr.Value);\n        }\n\n        [STAThread]\n        static void Main(string[] args)\n        {\n            var p0 = IntPtr.Zero;\n            var uuid = uuidof\u003cIDXGIFactory\u003e();\n            var ret = dxgi.CreateDXGIFactory(ref uuid, ref p0); // \u003c- Get IDXGIFactory as IntPtr\n            var o = Marshal.GetObjectForIUnknown(p0); // \u003c- IntPtr to RCW\n            var i = (IDXGIFactory)o; // \u003c- cast interface\n\n            IDXGIAdapter a = null;\n            i.EnumAdapters(0, ref a); // \u003c- Get interface\n            var desc = default(DXGI_ADAPTER_DESC);\n            a.GetDesc(ref desc);\n\n            Console.WriteLine(desc.Description);\n        }\n```\n\n### for dlang\n\n```\npython pycpptool/run.py gen 'C:/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/shared/dxgi.h' '-i' 'dxgicommon.h' '-i' 'dxgiformat.h' '-i' 'dxgitype.h' '-o' '../windowskits/source' '-g' 'dlang'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fousttrue%2Fpycpptool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fousttrue%2Fpycpptool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fousttrue%2Fpycpptool/lists"}