Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>42cpp_extension(beta)New to Visual Studio Code? Get it now.
42cpp_extension(beta)

42cpp_extension(beta)

matboyer

|
12 installs
| (0) | Free
toolkit for the cpp projects at 42 school
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C++ Class Canonical Form Builder - VSCode Extension (Beta)

This Visual Studio Code extension helps you quickly generate C++ classes in their canonical form by automatically creating the header and cpp files. Depending on the complexity level you choose, it also generates accessor methods (getters and setters) for the attributes in your class.

Features

  • Automatic Class Generation: Create both the header (.h) and implementation (.cpp) files with a single command.
  • Flexible Complexity Levels: Choose different levels of complexity to include or exclude accessor methods.
  • Customizable Attributes: Define class attributes using a simple syntax, and the extension will generate them in the appropriate form.

Command

To invoke the extension, use the following command in the VSCode command palette: ctr+shift+p canon

This command triggers the generation process.

Attribute Syntax (Beta)

In this beta release, attribute declarations must follow a specific syntax to ensure proper class generation. The supported syntax for declaring attributes is:

Examples:

  • Simple string attribute
    Input: s myString
    Output: std::string myString

  • Constant string attribute
    Input: cs myString
    Output: const std::string myString

Limitations in Beta

  • You must follow the exact ${type} ${name} syntax for attribute declarations.
  • The current release supports only predefined type shortcuts like s for std::string and cs for const std::string. any unrecognized char will result in an arror for now
  • current supported types : int > i float > f std::string > s
  • many errors are not handled for the moment, as said before, it only is the beta version for now version: 0.0.2
  • to stop sending new attributes to your function

Future Enhancements

In future releases, we plan to support:

  • More complex type handling.
  • Extended attribute customization.
  • Additional class features (e.g., inheritance, operator overloading, exceptions...).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft