diff options
author | 2011-07-03 16:21:04 -0400 | |
---|---|---|
committer | 2011-07-03 16:21:04 -0400 | |
commit | 388662d3221e193c6c6f913d4584b92ddf6dbcf5 (patch) | |
tree | 85df22bf9d1a37d9f660f8d74bcefb9b3f9447fe | |
parent | 7745f6d389483acb40e5575d09eff5031666e91a (diff) |
Basis.currentUrlHasQueryString
-rw-r--r-- | include/urweb.h | 1 | ||||
-rw-r--r-- | lib/ur/basis.urs | 1 | ||||
-rw-r--r-- | src/c/urweb.c | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/include/urweb.h b/include/urweb.h index 240623ee..9b68179a 100644 --- a/include/urweb.h +++ b/include/urweb.h @@ -339,6 +339,7 @@ uw_Basis_time *uw_Basis_readUtc(uw_context, uw_Basis_string); void uw_isPost(uw_context); uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context); +uw_Basis_bool uw_Basis_currentUrlHasQueryString(uw_context); void uw_cutErrorLocation(char *); diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 8da69c60..b60610cd 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -655,6 +655,7 @@ val bless : string -> url val checkUrl : string -> option url val currentUrl : transaction url val currentUrlHasPost : transaction bool +val currentUrlHasQueryString : transaction bool val url : transaction page -> url val effectfulUrl : (option queryString -> transaction page) -> url val redirect : t ::: Type -> url -> transaction t diff --git a/src/c/urweb.c b/src/c/urweb.c index e38cd072..b1785cb6 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3802,6 +3802,10 @@ uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context ctx) { return ctx->isPost; } +uw_Basis_bool uw_Basis_currentUrlHasQueryString(uw_context ctx) { + return ctx->queryString != NULL && ctx->queryString[0] != 0; +} + void uw_setQueryString(uw_context ctx, uw_Basis_string s) { ctx->queryString = s; } |