mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
40 lines
742 B
C
40 lines
742 B
C
|
#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)
|
||
|
{
|
||
|
}
|
||
|
};
|
||
|
}
|