From 2811cc9a77c17ac03aac9c1b582040827a76b0d9 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 27 Apr 2021 11:22:45 +0200 Subject: Squashed 'deps/cpp-httplib/' content from commit c58b005 git-subtree-dir: deps/cpp-httplib git-subtree-split: c58b00580ee66a248c2ef20334bb84319ccde310 --- split.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 split.py (limited to 'split.py') diff --git a/split.py b/split.py new file mode 100644 index 0000000..3bd0121 --- /dev/null +++ b/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') -- cgit v1.2.3