Giter Site home page Giter Site logo

hanzhi09 / cpp-class-creator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tzacee/cpp-class-creator

0.0 0.0 0.0 388 KB

A simple vscode extension to create formatted cpp class.

Home Page: https://marketplace.visualstudio.com/items?itemName=FleeXo.cpp-class-creator

License: GNU General Public License v3.0

JavaScript 28.04% TypeScript 71.96%

cpp-class-creator's Introduction

A simple C++ Class Creator with multiple settings ๐Ÿ‘ฝ

Hey I'm Maxim. I wanted created a little c++ extension to create classes.

I can work on it when I have time in order to improve it. Just open some Issues or Pull Request. Im happy to work on them!

Info about v1.0

In order to increase the flexiblity I implemented a command pattern which can be used to customize own presets for header/source files and it's names. For that I removed all customization options which I added in version <1.0. All of this options can be replaced with the new way of handling the files.

The syntax is {{*COMMAND*}} eg. {{*CLASSNAME*}}

Available Commands:

For file name presets:

  • CLASSNAMEUPPER - default classname to upper
  • CLASSNAMELOWER - default classname to lower
  • CLASSNAMECAPI - default classname with capitalized first letter
  • CLASSNAME - default classname

For file content presets:

  • HEADERFILENAME - default headerfilename as entered in settings
  • SOURCEFILENAME - default sourcefilename as entered in settings
  • CLASSNAMEUPPER - default classname to upper
  • CLASSNAMELOWER - default classname to lower
  • CLASSNAMECAPI - default classname with capitalized first letter
  • CLASSNAME - default classname

Features

Press Alt+X to open the Input Field to create a class, while you are focusing the editor!

Type in the name, and there you go. You will directly see, when the file is created.

Additionaly you can set the path where the file has to be created and customize your own header/source file preset: check Settings at the bottom.

Demo

Settings [settings.json of VS-Code]

"cpp.creator.headerFileContentPreset": = "string" customize your created headerfile content with this setting.

Default is:

   #ifndef {{*CLASSNAMEUPPER*}}_H
   #define {{*CLASSNAMEUPPER*}}_H
   
   #pragma once
   
   class {{*CLASSNAME*}}
   {
      public:
          {{*CLASSNAME*}}();
          ~{{*CLASSNAME*}}();
      private:
   };
   
   #endif

"cpp.creator.sourceFileContentPreset": = "string" customize your created sourcefile content with this setting.

Default is:

   #include "{{*HEADERFILENAME*}}"
   {{*CLASSNAME*}}::{{*CLASSNAME*}}()
   {

   }
   
   {{*CLASSNAME*}}::~{{*CLASSNAME*}}()
   {

   }

"cpp.creator.sourceFileNamePreset": = "string" customize your sourcefile name with this setting.

Default is:

   {{*CLASSNAME*}}.cpp

"cpp.creator.headerFileNamePreset": = "string" customize your headerfile name with this setting.

Default is:

   {{*CLASSNAME*}}.h

"cpp.creator.setPath": = "string" | null | boolean : [NULL by default] set your path where the class should be created as a string. When it's null your class will be created in the current workspace. Set it to true, when you want a input window to appear on every class creation where you can set creation path. On false or on an empty path input box it will also be created in the current workspace.

"cpp.creator.createFolder": = boolean : [FALSE by default] set it to true, so a folder for the class will be created in your workspace -> Only possible when setPath is null.


Have fun.

Make Pull Request when you have feature ideas & if you want, support me by sponsoring my github account :)

Changelog

  • See Info about v1.0

Enjoy!

                GNU GENERAL PUBLIC LICENSE
                   Version 3, 29 June 2007

cpp-class-creator's People

Contributors

andershogqvist avatar anlowho avatar belug23 avatar keithglassford avatar tzacee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.