mirror of https://github.com/adamdruppe/arsd.git
Merge remote branch 'trass3r/master'
This commit is contained in:
commit
2fb100516b
2
cgi.d
2
cgi.d
|
@ -981,7 +981,7 @@ class Cgi {
|
||||||
immutable(string[string]) get;
|
immutable(string[string]) get;
|
||||||
immutable(string[string]) post;
|
immutable(string[string]) post;
|
||||||
immutable(string[string]) cookies;
|
immutable(string[string]) cookies;
|
||||||
immutable(UploadedFile)[string] files;
|
immutable(UploadedFile[string]) files;
|
||||||
|
|
||||||
// Use these if you expect multiple items submitted with the same name. btw, assert(get[name] is getArray[name][$-1); should pass. Same for post and cookies.
|
// Use these if you expect multiple items submitted with the same name. btw, assert(get[name] is getArray[name][$-1); should pass. Same for post and cookies.
|
||||||
// the order of the arrays is the order the data arrives
|
// the order of the arrays is the order the data arrives
|
||||||
|
|
4
dom.d
4
dom.d
|
@ -2399,7 +2399,7 @@ class Document {
|
||||||
// found something in either branch...
|
// found something in either branch...
|
||||||
if(idx != -1) {
|
if(idx != -1) {
|
||||||
// read till a quote or about 12 chars, whichever comes first...
|
// read till a quote or about 12 chars, whichever comes first...
|
||||||
int end = idx;
|
auto end = idx;
|
||||||
while(end < dataAsBytes.length && dataAsBytes[end] != '"' && end - idx < 12)
|
while(end < dataAsBytes.length && dataAsBytes[end] != '"' && end - idx < 12)
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
|
@ -4018,7 +4018,7 @@ class StyleSheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
// unbelievable.
|
// unbelievable.
|
||||||
int indexOfBytes(immutable(ubyte)[] haystack, immutable(ubyte)[] needle) {
|
sizediff_t indexOfBytes(immutable(ubyte)[] haystack, immutable(ubyte)[] needle) {
|
||||||
auto found = std.algorithm.find(haystack, needle);
|
auto found = std.algorithm.find(haystack, needle);
|
||||||
if(found.length == 0)
|
if(found.length == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
4
html.d
4
html.d
|
@ -777,7 +777,7 @@ class CssAtRule : CssPart {
|
||||||
|
|
||||||
string content;
|
string content;
|
||||||
|
|
||||||
override CssPart clone() const {
|
override CssAtRule clone() const {
|
||||||
auto n = new CssAtRule();
|
auto n = new CssAtRule();
|
||||||
n.content = content;
|
n.content = content;
|
||||||
return n;
|
return n;
|
||||||
|
@ -897,7 +897,7 @@ class CssRule : CssPart {
|
||||||
// note: does not include the ending semicolon
|
// note: does not include the ending semicolon
|
||||||
string content;
|
string content;
|
||||||
|
|
||||||
override CssPart clone() const {
|
override CssRule clone() const {
|
||||||
auto n = new CssRule();
|
auto n = new CssRule();
|
||||||
n.content = content;
|
n.content = content;
|
||||||
return n;
|
return n;
|
||||||
|
|
10
web.d
10
web.d
|
@ -1500,7 +1500,9 @@ private string[] parameterNamesOfImpl (alias func) ()
|
||||||
string toHtml(T)(T a) {
|
string toHtml(T)(T a) {
|
||||||
string ret;
|
string ret;
|
||||||
|
|
||||||
static if(is(T : Document)) {
|
static if(is(T == typeof(null)))
|
||||||
|
ret = null;
|
||||||
|
else static if(is(T : Document)) {
|
||||||
if(a is null)
|
if(a is null)
|
||||||
ret = null;
|
ret = null;
|
||||||
else
|
else
|
||||||
|
@ -1547,7 +1549,9 @@ JSONValue toJsonValue(T, R = ApiProvider)(T a, string formatToStringAs = null, R
|
||||||
if(is(R : ApiProvider))
|
if(is(R : ApiProvider))
|
||||||
{
|
{
|
||||||
JSONValue val;
|
JSONValue val;
|
||||||
static if(is(T == JSONValue)) {
|
static if(is(T == typeof(null))) {
|
||||||
|
val.type = JSON_TYPE.NULL;
|
||||||
|
} else static if(is(T == JSONValue)) {
|
||||||
val = a;
|
val = a;
|
||||||
} else static if(__traits(compiles, val = a.makeJsonValue())) {
|
} else static if(__traits(compiles, val = a.makeJsonValue())) {
|
||||||
val = a.makeJsonValue();
|
val = a.makeJsonValue();
|
||||||
|
@ -1568,8 +1572,6 @@ JSONValue toJsonValue(T, R = ApiProvider)(T a, string formatToStringAs = null, R
|
||||||
val.type = JSON_TYPE.FLOAT;
|
val.type = JSON_TYPE.FLOAT;
|
||||||
val.floating = to!real(a);
|
val.floating = to!real(a);
|
||||||
static assert(0);
|
static assert(0);
|
||||||
} else static if(is(T == void*)) {
|
|
||||||
val.type = JSON_TYPE.NULL;
|
|
||||||
} else static if(isPointer!(T)) {
|
} else static if(isPointer!(T)) {
|
||||||
if(a is null) {
|
if(a is null) {
|
||||||
val.type = JSON_TYPE.NULL;
|
val.type = JSON_TYPE.NULL;
|
||||||
|
|
Loading…
Reference in New Issue