-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate.cpp
More file actions
29 lines (23 loc) · 808 Bytes
/
generate.cpp
File metadata and controls
29 lines (23 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <fstream>
using namespace std;
void main()
{
string outfile = "C:/Users/tikum/Documents/GitHub/matlab-nlopt/build/+nlopt/@options/nlopt_algorigthm_idstr.h";
string infile = "C:/Users/tikum/Documents/GitHub/matlab-nlopt/build/nlopt/include/nlopt.h";
ofstream out(outfile);
out << "#pragma once" << endl
<<"#include ""nlopt.h""" << endl
<< endl
<<"static const char nlopt_algorithm_idstrs[NLOPT_NUM_ALGORITHMS][256] = {" << endl;
std::ifstream in(infile);
}
// static const char nlopt_algorithm_short_names[NLOPT_NUM_ALGORITHMS][256] = {
// nlopt.h
// find: "NLOPT_GN_DIRECT = 0,"
// then find "} nlopt_algorithm;"
// strip "= 0"
//
// detect any "#ifdef NLOPT_CXX"..."#else"..."#endif" and only use else
// wrap each name in a pair of double quotes
//
//}