sporniket / ideas

My backlog of ideas, organized as a bunch of issues
0 stars 0 forks source link

[cpp] CPP Toolbox -- cipitobo --> cipito --> gepetto #37

Open sporniket opened 11 months ago

sporniket commented 11 months ago

CPP Toolbox -- cipitobo --> cipito --> gepetto

A set tools in python to generate boilerplate code for cpp

config : .gepetto.toml

[naming]
wordSeparation=caravan
# camel --> camel case, first letter is lowercase e.g. `eventHandlerOnWifiConnect` --> constant is `EVENT_HANDLER_ON_WIFI_CONNECT`
# snake --> snake case, all letter are lowercase e.g. `event_handler_on_wifi_connect` --> constant is `EVENT_HANDLER_ON_WIFI_CONNECT`
# caravan --> atomic groups of words in camel case, separated with underscore, like "a caravan of camels", e.g. `eventHandler_onWifiConnect` --> constant is `EVENT_HANDLER__ON_WIFI_CONNECT`
caravanSeparator=".,:;"
# the list of characters that create a separation between atomic groups of words. A sequence of such separation characters gives only one separation.
# e.g. `event handler,, on wifi connect` will give `eventHandler_onWifiConnect`

[licence]
spdxId=GPL-3.0-or-later
copyrightFirstYear=2019
copyrightHolders="David SPORN"
# multiple holders = "Anna DOE","Bernard DOE"

[includes]
groups=system,esp32,project

[group.system]
label=System
always=<cstdint>

[group.esp32]
label=Esp32 IdF

[group.project]
label=Project

CLI : gen blank

Synopsis

gepetto gen blank "event handler, on wifi connect" "path/to/include" ["path/to/src"]

Assuming the configuration described previously.

// Event handler, on wifi connect
// ---
// (c) 2019 to 2023 -- David SPORN
// SPDX-License-Identifier: GPL-3.0-or-later
// ---
#ifndef EVENT_HANDLER__ON_WIFI_CONNECT__HPP
#define EVENT_HANDLER__ON_WIFI_CONNECT__HPP

// --- System includes ---
#include <cstdint>

// --- Esp32 IdF includes ---

// --- Project includes ---

// --- your code here ---

#endif
sporniket commented 8 months ago

shortened version :

Synopsys

gpt --lang- something..md

code of lang

kind of code