npm install phid-srcgentoolsThe module exports two variables SrcGenTools and Lint.
To create and instance:
``javascript`
var PhidgetSrcGenTools = require('phid-srcgentools');
var gentools = new PhidgetSrcGenTools.SrcGenTools()
A number of C language specific bridge packet functions are also defined. Check the source or the SpecTools
Class Generator project for details.
The phidspec folder is stored in the SrcGenTools instance specdir member, and defaults to
phidhome/phidspec.
Lint is executed on each of the loaded spec files.
`javascript
var PhidgetSrcGenTools = require('phid-srcgentools');
var gentools = new PhidgetSrcGenTools.SrcGenTools()
var mods = gentools.loadPhidgetSpec();
`
`javascript
var WriteLn = require('phid-writeln');
var PhidgetSrcGenTools = require('phid-srcgentools');
var gentools = new PhidgetSrcGenTools.SrcGenTools()
var w = new WriteLn();
w.open('output.js');
gentools.writeObjectJS(obj, w, 'Object');
`
The specified class is expected to have been processed by mkTree().
The class comparison is done via the cls basename and the channel.class.
`javascript
var PhidgetSrcGenTools = require('phid-srcgentools');
var gentools = new PhidgetSrcGenTools.SrcGenTools()
function cb(cls, dev, ch, arg) {
}
gentools.foreachDeviceChannel(cls, cb, null);
``
1. String.endsWith()
2. String.startsWith()
3. String.lowerFirst()
4. String.upperFirst()