1.1.1 • Published 5 years ago

cpp-function-header v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

C++ Function Header

Zero dependency micro library to extract function headers data from C++ source code.

Install

npm install cpp-function-header

Running the tests

npm test

Example

import {ExtractFunctionHeader} from "cpp-function-header";

let cppSource = `
#include<iostream>
using namespace std;

int f_add(int x, int y) {
  return x + y;
}

int main() {
  int z = add(1, 2);
  return 0;
}`;

let header = ExtractFunctionHeader('f_add', cppSource);

Extraction's Result

interface FunctionParameter {
  name: string;
  type: string;
  dimensions: number;
}

interface FunctionHeader {
  functionName: string;
  returnType: string;
  parameters: FunctionParameter[];
  startIndex: number;
  endIndex: number;
}
1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.0

5 years ago