Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bastienkody/classmakercpp
Canonical form c++ classes definition maker (ecole 42 compliant)
https://github.com/bastienkody/classmakercpp
automation cpp cpp98 script
Last synced: about 1 month ago
JSON representation
Canonical form c++ classes definition maker (ecole 42 compliant)
- Host: GitHub
- URL: https://github.com/bastienkody/classmakercpp
- Owner: bastienkody
- Created: 2023-12-05T19:22:35.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-04T12:32:58.000Z (5 months ago)
- Last Synced: 2024-09-29T23:24:05.727Z (about 2 months ago)
- Topics: automation, cpp, cpp98, script
- Language: Shell
- Homepage:
- Size: 150 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# classMakerCpp
Othodox Canonical Form classes declaration script for c++std98 (ecole 42 compliant)## What is this?
Easy to use bash script that creates and populates both .hpp and .cpp files for a given class name.
* It implements Canonical form basics :
* Default constructor
* Default destructor
* Copy constructor
* Copy operator* But also few additionals :
* _name : std::string private member
* Parametric constructor (to _name)
* Getter on _name
* Setter on _name
* Ostream operator<< redefinition (it outputs _name)
* Includes for \ and \You want to modify some parts?
Feel free to fork the repo, or simply modify the script after having it cloned.## Quick install (single use)
In the repo you want your class files : `git clone [email protected]:bastienkody/classMakerCpp.git`## Permanent install (no sudo rights, ie. for 42 dumps)
* You need a specific directory to store you binaries such as : `mkdir ~/bin`
* Clone the repo anywhere : `cd /tmp && git clone [email protected]:bastienkody/classMakerCpp.git`
* Copy the .sh in ~/.bin : `cd /tmp ; cp classMakercpp.sh ~/.bin`
* You may define an alias saved in your .\rc : `echo "alias claspp='classMakercpp'" >> ~/.bashrc` (if zsh use : ~/.zshrc)
* Add your binaries repo to the PATH : `$PATH+=:~/bin`
* Make it permanent in your .\rc : `echo "$PATH+=:~/bin" >> ~/.bashrc` (if zsh use : ~/.zshrc)## Usage
* Launch the script : `./classMakercpp.sh `
* ClassName is a mandatory argument : the name of the class
* This would create both ClassName.cpp and Classname.hpp in your current directory## Illustrations
Command line :
![alt text](https://github.com/bastienkody/classMakerCpp/blob/main/images/command_line.png)
.hpp :
![alt text](https://github.com/bastienkody/classMakerCpp/blob/main/images/Animalhpp.png)
.cpp :
![alt text](https://github.com/bastienkody/classMakerCpp/blob/main/images/Animalcpp.png)