namespace-cc
Namespaces C++ files according to directory structure
Last updated 3 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install namespace-cc 
SYNC missed versions from official npm registry.

namespace-cc

Namespaces C++ files according to directory structure

Usage: namespace-cc <full-path-to-dir> '<space-separated-namespaced>'

Installation

npm install namespace-cc

Examples

Original

#ifndef RAPIDJSON_PARSER
#define RAPIDJSON_PARSER

class RapidJsonParser {
  public:
    RapidJsonParser(const char* json);
};

#endif

Run: namespace-cc ./mydir 'outer inner'

Result

#ifndef RAPIDJSON_PARSER
#define RAPIDJSON_PARSER

namespace outer {
namespace inner {

class RapidJsonParser {
  public:
    RapidJsonParser(const char* json);
};

}
}
#endif

API

namespaceDirectory

Namespaces all C++ files in the given directory. The files will be overwritten in place.

Parameters

  • dir string the directory to process
  • namespaces Array<string> the namespaces to enclose the definitions in, i.e. [ 'outer', 'inner' ]

Requirements

Node.js >= v8 (sorry, wanted to play with async/await).

License

MIT

Current Tags

  • 0.1.0                                ...           latest (3 years ago)

1 Versions

  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |