MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / createGenericColumnNames

Method createGenericColumnNames

src/helper.cpp:60–70  ·  view source on GitHub ↗

* Creates generic column names like "A", "B", ..., "Z", "AA", "AB", ... , "ZZ", "COL", "COL" * https://stackoverflow.com/questions/2294443/base-conversion-problem */

Source from the content-addressed store, hash-verified

58 * https://stackoverflow.com/questions/2294443/base-conversion-problem
59 */
60std::string Helper::createGenericColumnNames(int col) {
61 int v = col + 1;
62 int base = 26;
63 std::string res = "";
64 while( v != 0 ) {
65 --v;
66 res.insert(0, 1, (char)('A' + (v % base)));
67 v /= base;
68 }
69 return res;
70}
71
72
73/**

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected