Skip to content

A ridiculously simple mini web tool to generate C++ boilerplate files the way I like

Notifications You must be signed in to change notification settings

rpavlik/generate-cpp-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate C++ Boilerplate

I turned the shell scripts I habitually use to create new C++ files into a simple little PHP web app so my colleagues that aren't always in Linux can start the good habit too.

generate-cpp-boilerplate homepage on GitHub

Related: A PowerShell script (and another script that installs it) for making send-to menu items to generate files using this web app: Boilerplate Send-To

Original author: Ryan Pavlik, ryan.pavlik@gmail.com abiryan@ryand.net

Requirements

  • Needs PHP 5.3 or newer. (uses anonymous functions)

  • You may wish to use git-deploy to push to production, though since this is such a simple little set of php scripts it may be overkill. I've done the git deploy init task already, you just need to do the other ones listed on the git-deploy page.

Configuration

You'll probably want to fork and tweak things, and that's OK.

  • There are files that end in .sample: rename those to remove that string and edit to customize those details.
    • There are .txt files for the big chunks of text.
    • For indentation, it's easiest to use the config.php instead of a .txt file, which is why it looks like there are two ways of configuring indentation.
  • The files in templates are one place to start. If you add new templates, you'll have to edit common.php to add them to the maps.

The main actual templating code takes place in generate.php.

You can run ./test-locally if you have the php command installed (debian package php5-cli) to simulate a web hit without needing to set up apache and PHP.

Development and Testing

The Makefile is primarily for development, but does have a target to assist with deployment:

  • make or make build - Copies the required files for deployment into BUILD_DIR, defined by default as staging
  • make check - runs PHP in lint mode on the sources
  • make icon - Generates the favicon from SVG source; uses inkscape, pngcrush, and icotool (debian package icoutils)
  • make clean - Removes the staging directory and intermediate files from generating the favicon. (Does not remove the generated files committed to Git.)

Licenses

The full package is free and open-source software. The main code (in the root directory, templates, and support) are subject to the following license:

Copyright Iowa State University 2012.

Distributed under the Boost Software License, Version 1.0.

(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

The GUID generation code in external/guid.php is used unmodified from http://randomtweak.com/node/54

About

A ridiculously simple mini web tool to generate C++ boilerplate files the way I like

Resources

Stars

Watchers

Forks

Packages

No packages published