aboutsummaryrefslogtreecommitdiffstats
path: root/routing.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-04-03 01:38:08 +0900
committeripknHama <ipknhama@gmail.com>2014-04-03 08:29:22 +0900
commit5e5d69688435ffe8fc148af73fe33b029d9f6110 (patch)
tree1a37f2927e6825482404307346661a7b1c34300d /routing.h
parent4fdff79719af8d024f176bbdc03a57516e932602 (diff)
downloadcrow-5e5d69688435ffe8fc148af73fe33b029d9f6110.tar.gz
crow-5e5d69688435ffe8fc148af73fe33b029d9f6110.zip
preparing compile time url parsing
Diffstat (limited to 'routing.h')
-rw-r--r--routing.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/routing.h b/routing.h
new file mode 100644
index 0000000..ca9c0ec
--- /dev/null
+++ b/routing.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <cstdint>
+
+#include "utility.h"
+
+namespace flask
+{
+ namespace black_magic
+ {
+ constexpr bool is_equ_n(StrWrap a, int ai, StrWrap b, int bi, int n)
+ {
+ return n == 0 ? true : a[ai] != b[bi] ? false : is_equ_n(a,ai+1,b,bi+1,n-1);
+ }
+
+ constexpr bool is_int(StrWrap s, int i)
+ {
+ return is_equ_n(s, i, "<int>", 0, 5);
+ }
+
+ constexpr bool is_str(StrWrap s, int i)
+ {
+ return is_equ_n(s, i, "<str>", 0, 5);
+ }
+
+ //constexpr ? parse_route(StrWrap s)
+ //{
+ //return
+ //}
+ }
+
+ class Router
+ {
+ public:
+ constexpr Router(black_magic::StrWrap s)
+ {
+ }
+ };
+}