aboutsummaryrefslogtreecommitdiff
path: root/deps/cpp-httplib/split.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-27 11:22:45 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-04-27 11:22:45 +0200
commitdd086a1608b0e3cd5565174225b8197792bad4b9 (patch)
treebc31b1004aa94a2e978a310dbd04359948aed4d4 /deps/cpp-httplib/split.py
parent635f65e4a5bd168cb1c42c850260c8cfb685e8d3 (diff)
parent2811cc9a77c17ac03aac9c1b582040827a76b0d9 (diff)
Merge commit '2811cc9a77c17ac03aac9c1b582040827a76b0d9' as 'deps/cpp-httplib'
Diffstat (limited to 'deps/cpp-httplib/split.py')
-rw-r--r--deps/cpp-httplib/split.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/deps/cpp-httplib/split.py b/deps/cpp-httplib/split.py
new file mode 100644
index 0000000..3bd0121
--- /dev/null
+++ b/deps/cpp-httplib/split.py
@@ -0,0 +1,32 @@
+import os
+import sys
+
+border = '// ----------------------------------------------------------------------------'
+
+PythonVersion = sys.version_info[0];
+
+with open('httplib.h') as f:
+ lines = f.readlines()
+ inImplementation = False
+
+ if PythonVersion < 3:
+ os.makedirs('out')
+ else:
+ os.makedirs('out', exist_ok=True)
+
+ with open('out/httplib.h', 'w') as fh:
+ with open('out/httplib.cc', 'w') as fc:
+ fc.write('#include "httplib.h"\n')
+ fc.write('namespace httplib {\n')
+ for line in lines:
+ isBorderLine = border in line
+ if isBorderLine:
+ inImplementation = not inImplementation
+ else:
+ if inImplementation:
+ fc.write(line.replace('inline ', ''))
+ pass
+ else:
+ fh.write(line)
+ pass
+ fc.write('} // namespace httplib\n')